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

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 0336a78b604ce21d8f3eefc68c6b27f01db88495..b5ec1138c2557f5c7da85e2e637f1a214d586ec8 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;
}

Powered by Google App Engine
This is Rietveld 408576698