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

For hashing type name, using std::hash<std::string_view> instead of std::hash<std::string> #351

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

zhqrbitee
Copy link
Contributor

Switch from std::hash<string> to std::hash<string_view> to avoid creating new std::string (which could involve memory allocation and copy) when doing hash for type name.

std::hash<string> to avoid creating new std::string when doing hash,
which involve unnecessary memory allocation and copy
@wjakob wjakob merged commit 258ee09 into wjakob:master Nov 2, 2023
21 checks passed
@wjakob
Copy link
Owner

wjakob commented Nov 2, 2023

Nice!

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