[llvm] [ADT] Fix comment typos in DenseMap.h (PR #158457)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 13 22:33:12 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-adt
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
- The math is wrong.
- We are discussing "inequality".
- "For example" requires ",".
---
Full diff: https://github.com/llvm/llvm-project/pull/158457.diff
1 Files Affected:
- (modified) llvm/include/llvm/ADT/DenseMap.h (+2-2)
``````````diff
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);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/158457
More information about the llvm-commits
mailing list