Skip to content

Commit 6ce870d

Browse files
committed
better name, a few more comments
1 parent bcbba18 commit 6ce870d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/std/comptime_string_map.zig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
const std = @import("std.zig");
22

3+
/// 'comptime' optimized mapping between string keys and associated values.
34
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);
56
}
67

8+
/// Same as ComptimeStringMap, except keys are compared case-insensitively.
79
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);
911
}
1012

1113
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 {
3739

3840
/// Static string map constructed at compile time for additional optimizations.
3941
/// First branches on the key length, then compares the possible matching keys.
40-
pub fn ComptimeStringMapWithEql(
42+
pub fn ComptimeStringMapAdvanced(
4143
/// The type of the value
4244
comptime V: type,
4345
/// The type of the element in the array, eg. []const T - would be u8 for a string

lib/std/std.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub const BufMap = @import("buf_map.zig").BufMap;
1616
pub const BufSet = @import("buf_set.zig").BufSet;
1717
pub const ComptimeStringMap = comptime_string_map.ComptimeStringMap;
1818
pub const ComptimeStringMapIgnoreCase = comptime_string_map.ComptimeStringMapIgnoreCase;
19-
pub const ComptimeStringMapWithEql = comptime_string_map.ComptimeStringMapWithEql;
19+
pub const ComptimeStringMapAdvanced = comptime_string_map.ComptimeStringMapAdvanced;
2020
pub const DoublyLinkedList = @import("linked_list.zig").DoublyLinkedList;
2121
pub const DynLib = @import("dynamic_library.zig").DynLib;
2222
pub const DynamicBitSet = bit_set.DynamicBitSet;

0 commit comments

Comments
 (0)