From 4fb88349d388f57db1819b6175adf885dac13235 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 1 Jun 2013 16:37:55 +0000 Subject: [PATCH] DenseMap: Move the key into place when we use the move version of operator[]. llvm-svn: 183074 --- llvm/include/llvm/ADT/DenseMap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h index 31fd6d899dae..d5aa8646b31c 100644 --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/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