diff options
Diffstat (limited to 'src/comptime_string_map.zig')
-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); } } |