From: Benjamin Kramer Date: Sat, 1 Jun 2013 16:37:55 +0000 (+0000) Subject: DenseMap: Move the key into place when we use the move version of operator[]. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=da8b91a0731e34b97aadb0241ba6cefa4481cffa;p=oota-llvm.git DenseMap: Move the key into place when we use the move version of operator[]. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183074 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 31fd6d899da..d5aa8646b31 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -222,11 +222,11 @@ public: if (LookupBucketFor(Key, TheBucket)) return *TheBucket; - return *InsertIntoBucket(Key, ValueT(), TheBucket); + return *InsertIntoBucket(std::move(Key), ValueT(), TheBucket); } ValueT &operator[](KeyT &&Key) { - return FindAndConstruct(Key).second; + return FindAndConstruct(std::move(Key)).second; } #endif