Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case-insensitive map_string_key #571

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

lihuiba
Copy link
Collaborator

@lihuiba lihuiba commented Sep 25, 2024

No description provided.

assert(sv.size() <= BUF_CAP);
for (size_t j = 0; j < sv.size(); ++j)
buf[j] = (char)tolower(sv[j]);
return std::hash<std::string_view>()({buf, n});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better if using template parameter to set hasher (and even combine hasher) for parts instead of std::hash<std::string_view>.

hasher for unordered_map_string_key can be set by template parameter, so unordered_map_string_key_case_insensitive would be better able to set hasher.

Copy link
Collaborator

@Coldwings Coldwings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lihuiba lihuiba merged commit c12f913 into alibaba:main Sep 27, 2024
11 checks passed
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.

2 participants