[llvm] f6157c7 - [ADT] Remove a meaningless std::move (NFC) (#156138)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 30 10:01:23 PDT 2025


Author: Kazu Hirata
Date: 2025-08-30T10:01:19-07:00
New Revision: f6157c71ab645f7db8564193d33690e28a9839eb

URL: https://github.com/llvm/llvm-project/commit/f6157c71ab645f7db8564193d33690e28a9839eb
DIFF: https://github.com/llvm/llvm-project/commit/f6157c71ab645f7db8564193d33690e28a9839eb.diff

LOG: [ADT] Remove a meaningless std::move (NFC) (#156138)

std::move on StringRef is not useful because it's copied anyway.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/StringMap.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
index dbc0485967ac6..e8100abec8d3a 100644
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -264,7 +264,7 @@ class LLVM_ALLOCATORHOLDER_EMPTYBASE StringMap
   /// at - Return the entry for the specified key, or abort if no such
   /// entry exists.
   const ValueTy &at(StringRef Val) const {
-    auto Iter = this->find(std::move(Val));
+    auto Iter = this->find(Val);
     assert(Iter != this->end() && "StringMap::at failed due to a missing key");
     return Iter->second;
   }


        


More information about the llvm-commits mailing list