fix: bug hunt

This commit is contained in:
2026-07-24 22:38:36 +02:00
parent 8b50eb7606
commit 96275121be
6 changed files with 334 additions and 70 deletions
+2 -1
View File
@@ -64,7 +64,7 @@ init func($V type, $N usize, $entries [N]Pair(V)) StaticStringMap(V) {
max_len u32 :: u32(keys[N - 1].len)
len_indexes [usize(max_len) + 1]mut u32 = undefined
entry_index usize = 0
for 0..=(usize(max_len)) |length| {
for 0..=usize(max_len) |length| {
while entry_index < N and keys[entry_index].len < length : entry_index += 1 {}
len_indexes[length] = u32(entry_index)
}
@@ -90,4 +90,5 @@ get func($V type, map @StaticStringMap(V), key []u8) ?V {
if (candidate.len != key.len) return null
if mem.eql(u8, candidate, key) return map.values[idx]
}
return null
}