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

Unified Diff: chrome/browser/sync_file_system/drive_backend/list_changes_task.cc

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: Created 3 years, 11 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
Index: chrome/browser/sync_file_system/drive_backend/list_changes_task.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc b/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc
index 7d8d79367413a005e66ac2a3ddea2915c484bb16..9991ff3cfda63aebeafc4a17afc2c7edef9fb2e5 100644
--- a/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc
+++ b/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc
@@ -75,12 +75,12 @@ void ListChangesTask::DidListChanges(
return;
}
- std::vector<google_apis::ChangeResource*> changes;
- change_list->mutable_items()->release(&changes);
-
- change_list_.reserve(change_list_.size() + changes.size());
- for (size_t i = 0; i < changes.size(); ++i)
- change_list_.push_back(changes[i]);
+ change_list_.reserve(change_list_.size() +
+ change_list->mutable_items()->size());
+ std::move(change_list->mutable_items()->begin(),
+ change_list->mutable_items()->end(),
+ std::back_inserter(change_list_));
+ change_list->mutable_items()->clear();
Avi (use Gerrit) 2017/01/09 17:18:29 And a move + back_inserter again...
leonhsl(Using Gerrit) 2017/01/10 04:39:36 :)
if (!change_list->next_link().is_empty()) {
drive_service()->GetRemainingChangeList(

Powered by Google App Engine
This is Rietveld 408576698