Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2241)

Unified Diff: base/containers/small_map.h

Issue 1738883004: Support for move-only types in SmallMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/containers/small_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/small_map.h
diff --git a/base/containers/small_map.h b/base/containers/small_map.h
index 427736ca8c22ada63b5c71479a9af77a6ec601ac..82ed6c5473ce7c9484534795ef0a41e674968c50 100644
--- a/base/containers/small_map.h
+++ b/base/containers/small_map.h
@@ -517,7 +517,7 @@ class SmallMap {
array_[i].Destroy();
--size_;
if (i != size_) {
- array_[i].Init(*array_[size_]);
+ array_[i].InitFromMove(std::move(array_[size_]));
array_[size_].Destroy();
}
} else {
@@ -594,7 +594,7 @@ class SmallMap {
ManualConstructor<value_type> temp_array[kArraySize];
for (int i = 0; i < kArraySize; i++) {
- temp_array[i].Init(*array_[i]);
+ temp_array[i].InitFromMove(std::move(array_[i]));
array_[i].Destroy();
}
@@ -604,7 +604,7 @@ class SmallMap {
// Insert elements into it.
for (int i = 0; i < kArraySize; i++) {
- map_->insert(*temp_array[i]);
+ map_->insert(std::move(*temp_array[i]));
temp_array[i].Destroy();
}
}
« no previous file with comments | « no previous file | base/containers/small_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698