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

Unified Diff: chrome/browser/sync/glue/bookmark_change_processor.cc

Issue 1105413002: Avoid conversion of index to BookmarkNode pointer unnacessarily. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 8 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/glue/bookmark_change_processor.cc
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index ee1e4caeabf0d1dc5177b0e47349e1393650ccd8..5dae460db04944c559b2513c4c9fbbabefacd79d 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -607,7 +607,7 @@ void BookmarkChangeProcessor::ApplyChangesFromSyncModel(
const BookmarkNode* parent = dst->parent();
int index = parent->GetIndexOf(dst);
if (index > -1)
- model->Remove(parent, index);
+ model->Remove(parent->GetChild(index));
}
// A map to keep track of some reordering work we defer until later.
@@ -709,8 +709,7 @@ void BookmarkChangeProcessor::ApplyChangesFromSyncModel(
if (foster_parent) {
// There should be no nodes left under the foster parent.
DCHECK_EQ(foster_parent->child_count(), 0);
- model->Remove(foster_parent->parent(),
- foster_parent->parent()->GetIndexOf(foster_parent));
+ model->Remove(foster_parent);
foster_parent = NULL;
}
« no previous file with comments | « chrome/browser/history/android/bookmark_model_sql_handler.cc ('k') | chrome/browser/sync/glue/bookmark_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698