[clang] 77b309d - [AST] Avoid repeated hash lookups (NFC) (#127299)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 15 01:35:05 PST 2025
Author: Kazu Hirata
Date: 2025-02-15T01:35:01-08:00
New Revision: 77b309d0721b70f7e2e646f50317478fa76b1ba5
URL: https://github.com/llvm/llvm-project/commit/77b309d0721b70f7e2e646f50317478fa76b1ba5
DIFF: https://github.com/llvm/llvm-project/commit/77b309d0721b70f7e2e646f50317478fa76b1ba5.diff
LOG: [AST] Avoid repeated hash lookups (NFC) (#127299)
Added:
Modified:
clang/lib/AST/VTableBuilder.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp
index 19d76df99dbe3..18893b996b5d6 100644
--- a/clang/lib/AST/VTableBuilder.cpp
+++ b/clang/lib/AST/VTableBuilder.cpp
@@ -2115,8 +2115,8 @@ void ItaniumVTableBuilder::dumpLayout(raw_ostream &Out) {
// Dump the next address point.
uint64_t NextIndex = Index + 1;
- if (AddressPointsByIndex.count(NextIndex)) {
- if (AddressPointsByIndex.count(NextIndex) == 1) {
+ if (unsigned Count = AddressPointsByIndex.count(NextIndex)) {
+ if (Count == 1) {
const BaseSubobject &Base =
AddressPointsByIndex.find(NextIndex)->second;
More information about the cfe-commits
mailing list