diff --git a/llvm/include/llvm/ADT/StringMapEntry.h b/llvm/include/llvm/ADT/StringMapEntry.h index 98b51cc1aebd5..d93af5aedc39d 100644 --- a/llvm/include/llvm/ADT/StringMapEntry.h +++ b/llvm/include/llvm/ADT/StringMapEntry.h @@ -116,9 +116,7 @@ class StringMapEntry final : public StringMapEntryStorage { return reinterpret_cast(this + 1); } - StringRef first() const { - return StringRef(getKeyData(), this->getKeyLength()); - } + StringRef first() const { return getKey(); } /// Create a StringMapEntry for the specified key construct the value using /// \p InitiVals.