[llvm] 3336c6c - [ADT] Fix comment typos in DenseMap.h (#158457)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 14 07:07:57 PDT 2025
Author: Kazu Hirata
Date: 2025-09-14T07:07:53-07:00
New Revision: 3336c6cc2c7e729f6b292ba3929b6c083fcff21b
URL: https://github.com/llvm/llvm-project/commit/3336c6cc2c7e729f6b292ba3929b6c083fcff21b
DIFF: https://github.com/llvm/llvm-project/commit/3336c6cc2c7e729f6b292ba3929b6c083fcff21b.diff
LOG: [ADT] Fix comment typos in DenseMap.h (#158457)
- The math is wrong.
- We are discussing "inequality".
- "For example" requires ",".
Added:
Modified:
llvm/include/llvm/ADT/DenseMap.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index f076049c55a26..23b672eaf8b47 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -372,8 +372,8 @@ class DenseMapBase : public DebugEpochBase {
// Ensure that "NumEntries * 4 < NumBuckets * 3"
if (NumEntries == 0)
return 0;
- // +1 is required because of the strict equality.
- // For example if NumEntries is 48, we need to return 401.
+ // +1 is required because of the strict inequality.
+ // For example, if NumEntries is 48, we need to return 128.
return NextPowerOf2(NumEntries * 4 / 3 + 1);
}
More information about the llvm-commits
mailing list