|
1 | 1 | const std = @import("std.zig");
|
2 | 2 |
|
| 3 | +/// 'comptime' optimized mapping between string keys and associated values. |
3 | 4 | pub fn ComptimeStringMap(comptime V: type, comptime kvs_list: anytype) type {
|
4 |
| - return ComptimeStringMapWithEql(V, u8, kvs_list, defaultEql); |
| 5 | + return ComptimeStringMapAdvanced(V, u8, kvs_list, defaultEql); |
5 | 6 | }
|
6 | 7 |
|
| 8 | +/// Same as ComptimeStringMap, except keys are compared case-insensitively. |
7 | 9 | pub fn ComptimeStringMapIgnoreCase(comptime V: type, comptime kvs_list: anytype) type {
|
8 |
| - return ComptimeStringMapWithEql(V, u8, kvs_list, ignoreCaseEql); |
| 10 | + return ComptimeStringMapAdvanced(V, u8, kvs_list, ignoreCaseEql); |
9 | 11 | }
|
10 | 12 |
|
11 | 13 | fn defaultEql(comptime T: type, comptime len: usize, comptime expected: [len]u8, actual: [len]u8) bool {
|
@@ -37,7 +39,7 @@ fn toLowerSimd(comptime len: usize, input: [len]u8) [len]u8 {
|
37 | 39 |
|
38 | 40 | /// Static string map constructed at compile time for additional optimizations.
|
39 | 41 | /// First branches on the key length, then compares the possible matching keys.
|
40 |
| -pub fn ComptimeStringMapWithEql( |
| 42 | +pub fn ComptimeStringMapAdvanced( |
41 | 43 | /// The type of the value
|
42 | 44 | comptime V: type,
|
43 | 45 | /// The type of the element in the array, eg. []const T - would be u8 for a string
|
|
0 commit comments