Skip to content

Conversation

kazutakahirata
Copy link
Contributor

  • The math is wrong.
  • We are discussing "inequality".
  • "For example" requires ",".

- The math is wrong.
- We are discussing "inequality".
- "For example" requires ",".
@llvmbot
Copy link
Member

llvmbot commented Sep 14, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes
  • 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 --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);
   }
 

@kazutakahirata kazutakahirata merged commit 3336c6c into llvm:main Sep 14, 2025
11 of 12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250913_DenseMap_comment branch September 14, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants