[llvm] [clang] Deduplicate the logic between StringMapEntry.first() and StringMapEntry.getKey() (PR #113735)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 13:06:31 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-adt

Author: Boaz Brickner (bricknerb)

<details>
<summary>Changes</summary>

Zero behavior diff.

---
Full diff: https://github.com/llvm/llvm-project/pull/113735.diff


1 Files Affected:

- (modified) llvm/include/llvm/ADT/StringMapEntry.h (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/ADT/StringMapEntry.h b/llvm/include/llvm/ADT/StringMapEntry.h
index 98b51cc1aebd59..a3ff2415869be6 100644
--- a/llvm/include/llvm/ADT/StringMapEntry.h
+++ b/llvm/include/llvm/ADT/StringMapEntry.h
@@ -117,7 +117,7 @@ class StringMapEntry final : public StringMapEntryStorage<ValueTy> {
   }
 
   StringRef first() const {
-    return StringRef(getKeyData(), this->getKeyLength());
+    return getKey();
   }
 
   /// Create a StringMapEntry for the specified key construct the value using

``````````

</details>


https://github.com/llvm/llvm-project/pull/113735


More information about the llvm-commits mailing list