aboutsummaryrefslogtreecommitdiff
path: root/src/string_immutable.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-07 03:21:58 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-07 03:21:58 -0700
commit1d1a70c21fc1f6e9e618cb52262e21bc37ac4be3 (patch)
treec942103d08048141f417a4b75130326b53b73cb9 /src/string_immutable.zig
parentd59e7b27b0b525126fe5011f5ab393f9f5e6659a (diff)
downloadbun-1d1a70c21fc1f6e9e618cb52262e21bc37ac4be3.tar.gz
bun-1d1a70c21fc1f6e9e618cb52262e21bc37ac4be3.tar.zst
bun-1d1a70c21fc1f6e9e618cb52262e21bc37ac4be3.zip
WIP error css
Former-commit-id: 36f03bf491cf274f68361e334a706538464ee271
Diffstat (limited to '')
-rw-r--r--src/string_immutable.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index 055239c1a..238706f93 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -363,6 +363,23 @@ inline fn eqlComptimeCheckLen(self: string, comptime alt: anytype, comptime chec
const second = comptime std.mem.readIntNative(u64, alt[8..15]);
return ((comptime !check_len) or self.len == alt.len) and first == std.mem.readIntNative(u64, self[0..8]) and second == std.mem.readIntNative(u64, self[8..16]);
},
+ 23 => {
+ const first = comptime std.mem.readIntNative(u64, alt[0..8]);
+ const second = comptime std.mem.readIntNative(u64, alt[8..15]);
+ return ((comptime !check_len) or self.len == alt.len) and
+ first == std.mem.readIntNative(u64, self[0..8]) and
+ second == std.mem.readIntNative(u64, self[8..16]) and
+ eqlComptimeIgnoreLen(self[16..23], comptime alt[16..23]);
+ },
+ 24 => {
+ const first = comptime std.mem.readIntNative(u64, alt[0..8]);
+ const second = comptime std.mem.readIntNative(u64, alt[8..16]);
+ const third = comptime std.mem.readIntNative(u64, alt[16..24]);
+ return ((comptime !check_len) or self.len == alt.len) and
+ first == std.mem.readIntNative(u64, self[0..8]) and
+ second == std.mem.readIntNative(u64, self[8..16]) and
+ third == std.mem.readIntNative(u64, self[16..24]);
+ },
else => {
@compileError(alt ++ " is too long.");
},