diff options
author | 2022-11-30 05:49:01 -0800 | |
---|---|---|
committer | 2022-11-30 05:49:01 -0800 | |
commit | 6213a91f058cc461fb916d479f03f602c552c377 (patch) | |
tree | 5442b8e30a1eebfda378586913dd56a27bd3ba88 /src/comptime_string_map.zig | |
parent | f999bdca26256b7ad42d93268c34362b251330c2 (diff) | |
download | bun-jarred/make-strings-better.tar.gz bun-jarred/make-strings-better.tar.zst bun-jarred/make-strings-better.zip |
[wip internal] Introduce `bun.String` which wraps `WTF::String` and allows us to reuse themjarred/make-strings-better
Diffstat (limited to '')
-rw-r--r-- | src/comptime_string_map.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/comptime_string_map.zig b/src/comptime_string_map.zig index 18b06d9de..5f3779c9b 100644 --- a/src/comptime_string_map.zig +++ b/src/comptime_string_map.zig @@ -134,12 +134,13 @@ pub fn ComptimeStringMapWithKeyType(comptime KeyType: type, comptime V: type, co } pub fn getWithEql(input: anytype, comptime eql: anytype) ?V { - if (input.len < precomputed.min_len or input.len > precomputed.max_len) + const length = input.length(); + if (length < precomputed.min_len or length > precomputed.max_len) return null; comptime var i: usize = precomputed.min_len; inline while (i <= precomputed.max_len) : (i += 1) { - if (input.len == i) { + if (length == i) { return getWithLengthAndEql(input, i, eql); } } |