forked from OSchip/llvm-project
DenseMap: Move the key into place when we use the move version of operator[].
llvm-svn: 183074
This commit is contained in:
parent
b565f89929
commit
4fb88349d3
|
@ -222,11 +222,11 @@ public:
|
||||||
if (LookupBucketFor(Key, TheBucket))
|
if (LookupBucketFor(Key, TheBucket))
|
||||||
return *TheBucket;
|
return *TheBucket;
|
||||||
|
|
||||||
return *InsertIntoBucket(Key, ValueT(), TheBucket);
|
return *InsertIntoBucket(std::move(Key), ValueT(), TheBucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueT &operator[](KeyT &&Key) {
|
ValueT &operator[](KeyT &&Key) {
|
||||||
return FindAndConstruct(Key).second;
|
return FindAndConstruct(std::move(Key)).second;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue