[llvm] [ADT][NFC] Remove unused parameter from DenseMap::InsertIntoBucketImpl (PR #108382)

Marc Auberer via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 06:00:57 PDT 2024


https://github.com/marcauberer created https://github.com/llvm/llvm-project/pull/108382

Remove unused parameter `Key` from `InsertIntoBucketImpl`

>From 4f21579cc5455609e5726a062bfa939c36c6adb7 Mon Sep 17 00:00:00 2001
From: Marc Auberer <marc.auberer at sap.com>
Date: Thu, 12 Sep 2024 12:55:50 +0000
Subject: [PATCH] [ADT][NFC] Remove unused parameter from
 DenseMap::InsertIntoBucketImpl

---
 llvm/include/llvm/ADT/DenseMap.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index 083d5c9388f7c8..7535eb2dad0200 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -570,7 +570,7 @@ class DenseMapBase : public DebugEpochBase {
   template <typename KeyArg, typename... ValueArgs>
   BucketT *InsertIntoBucket(BucketT *TheBucket, KeyArg &&Key,
                             ValueArgs &&...Values) {
-    TheBucket = InsertIntoBucketImpl(Key, Key, TheBucket);
+    TheBucket = InsertIntoBucketImpl(Key, TheBucket);
 
     TheBucket->getFirst() = std::forward<KeyArg>(Key);
     ::new (&TheBucket->getSecond()) ValueT(std::forward<ValueArgs>(Values)...);
@@ -580,7 +580,7 @@ class DenseMapBase : public DebugEpochBase {
   template <typename LookupKeyT>
   BucketT *InsertIntoBucketWithLookup(BucketT *TheBucket, KeyT &&Key,
                                       ValueT &&Value, LookupKeyT &Lookup) {
-    TheBucket = InsertIntoBucketImpl(Key, Lookup, TheBucket);
+    TheBucket = InsertIntoBucketImpl(Lookup, TheBucket);
 
     TheBucket->getFirst() = std::move(Key);
     ::new (&TheBucket->getSecond()) ValueT(std::move(Value));
@@ -588,8 +588,7 @@ class DenseMapBase : public DebugEpochBase {
   }
 
   template <typename LookupKeyT>
-  BucketT *InsertIntoBucketImpl(const KeyT &Key, const LookupKeyT &Lookup,
-                                BucketT *TheBucket) {
+  BucketT *InsertIntoBucketImpl(const LookupKeyT &Lookup, BucketT *TheBucket) {
     incrementEpoch();
 
     // If the load of the hash table is more than 3/4, or if fewer than 1/8 of



More information about the llvm-commits mailing list