Skip to content

Conversation

@squeek502
Copy link
Member

This will allow users to construct e.g. a ComptimeStringMap that uses case-insensitive ASCII comparison.

Note: the previous ComptimeStringMap API is unchanged (i.e. this does not break any existing code).

(the motivating use case for this comes from #17069)

Prior art: #5520

This will allow users to construct e.g. a ComptimeStringMap that uses case-insensitive ASCII comparison.

Note: the previous ComptimeStringMap API is unchanged (i.e. this does not break any existing code).
@andrewrk andrewrk merged commit c9613e3 into ziglang:master Sep 14, 2023
@Jarred-Sumner
Copy link
Contributor

FWIW, we had a similar need in Bun and rather than a single hardcoded equality function, we needed multiple equality functions for different usecases.

https://github.com/oven-sh/bun/blob/main/src/comptime_string_map.zig#L185-L199

@squeek502
Copy link
Member Author

@Jarred-Sumner that is similar to the approach taken in #5520. Definitely seems possible that it's a better way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants