Skip to content

[TextAPI] Use MapVector::try_emplace (NFC) #143564

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

Merged

Conversation

kazutakahirata
Copy link
Contributor

  • try_emplace(Key) is shorter than insert({Key, nullptr}).
  • try_emplace performs value initialization without value parameters.
  • We overwrite values on successful insertion anyway.

- try_emplace(Key) is shorter than insert({Key, nullptr}).
- try_emplace performs value initialization without value parameters.
- We overwrite values on successful insertion anyway.
@kazutakahirata kazutakahirata requested review from arsenm, shiltian and tgymnich and removed request for cyndyishida June 10, 2025 15:57
@kazutakahirata kazutakahirata merged commit 9bda38f into llvm:main Jun 10, 2025
8 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250610_try_emplace_llvm branch June 10, 2025 18:36
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
- try_emplace(Key) is shorter than insert({Key, nullptr}).
- try_emplace performs value initialization without value parameters.
- We overwrite values on successful insertion anyway.
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
- try_emplace(Key) is shorter than insert({Key, nullptr}).
- try_emplace performs value initialization without value parameters.
- We overwrite values on successful insertion anyway.
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