[llvm] [ADT] Fix comment typos in DenseMap.h (PR #158457)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 13 22:32:38 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/158457
- The math is wrong.
- We are discussing "inequality".
- "For example" requires ",".
>From 47573857dcb5e7468249652840ee9aeca7186799 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 13 Sep 2025 21:00:10 -0700
Subject: [PATCH] [ADT] Fix comment typos in DenseMap.h
- The math is wrong.
- We are discussing "inequality".
- "For example" requires ",".
---
llvm/include/llvm/ADT/DenseMap.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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