diff options
author | 2022-04-11 01:44:25 -0700 | |
---|---|---|
committer | 2022-04-11 01:44:25 -0700 | |
commit | ac3835227eb66ea340122db614e6f32fa17a5697 (patch) | |
tree | 62e3ee5c41731f18f303750b60c77cd06846b028 /src/comptime_string_map.zig | |
parent | c6393bcd27b376ec07d7d9b8606791b4db33fcaf (diff) | |
download | bun-ac3835227eb66ea340122db614e6f32fa17a5697.tar.gz bun-ac3835227eb66ea340122db614e6f32fa17a5697.tar.zst bun-ac3835227eb66ea340122db614e6f32fa17a5697.zip |
Update comptime_string_map.zig
Diffstat (limited to 'src/comptime_string_map.zig')
-rw-r--r-- | src/comptime_string_map.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/comptime_string_map.zig b/src/comptime_string_map.zig index b4cc733e1..546f928c9 100644 --- a/src/comptime_string_map.zig +++ b/src/comptime_string_map.zig @@ -85,6 +85,8 @@ pub fn ComptimeStringMapWithKeyType(comptime KeyType: type, comptime V: type, co comptime var i = len_indexes[len]; + // This benchmarked faster for both small and large lists of strings than using a big switch statement + // But only so long as the keys are a sorted list. inline while (i < end) : (i += 1) { if (strings.eqlComptimeCheckLenWithType(KeyType, str, kvs[i].key, false)) { return kvs[i].value; |