diff options
author | 2022-11-20 17:58:13 -0800 | |
---|---|---|
committer | 2022-11-20 17:58:13 -0800 | |
commit | a251669fa1ef9dc148d3477d6f5721db01dd5f60 (patch) | |
tree | a0b5f99bf80bf5ccf88c5b7ce50ff246a75b0946 /src/string_immutable.zig | |
parent | 4f6636b3ca942080e1d58eff02c82d102be7db7c (diff) | |
download | bun-a251669fa1ef9dc148d3477d6f5721db01dd5f60.tar.gz bun-a251669fa1ef9dc148d3477d6f5721db01dd5f60.tar.zst bun-a251669fa1ef9dc148d3477d6f5721db01dd5f60.zip |
Make it yellow
Diffstat (limited to '')
-rw-r--r-- | src/string_immutable.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 9a0165020..38701698c 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -652,6 +652,10 @@ pub fn hasPrefixComptime(self: string, comptime alt: anytype) bool { return self.len >= alt.len and eqlComptimeCheckLenWithType(u8, self[0..alt.len], alt, false); } +/// Check if two strings are equal with one of the strings being a comptime-known value +/// +/// strings.eqlComptime(input, "hello world"); +/// strings.eqlComptime(input, "hai"); pub inline fn eqlComptimeCheckLenWithType(comptime Type: type, a: []const Type, comptime b: anytype, comptime check_len: bool) bool { @setEvalBranchQuota(9999); if (comptime check_len) { |