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

Unified Diff: chrome/browser/android/provider/chrome_browser_provider.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/android/provider/chrome_browser_provider.cc
diff --git a/chrome/browser/android/provider/chrome_browser_provider.cc b/chrome/browser/android/provider/chrome_browser_provider.cc
index 68121bd297c4cafed26e2fc9de8b5e3489f9268c..08d23abb848a4fa7f83e53cc464da95d3ef3aaf9 100644
--- a/chrome/browser/android/provider/chrome_browser_provider.cc
+++ b/chrome/browser/android/provider/chrome_browser_provider.cc
@@ -260,10 +260,8 @@ class RemoveBookmarkTask : public BookmarkModelObserverTask {
static void RunOnUIThread(BookmarkModel* model, const int64 id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const BookmarkNode* node = bookmarks::GetBookmarkNodeByID(model, id);
- if (node && node->parent()) {
- const BookmarkNode* parent_node = node->parent();
- model->Remove(parent_node, parent_node->GetIndexOf(node));
- }
+ if (node && node->parent())
+ model->Remove(node);
}
// Verify that the bookmark was actually removed. Called synchronously.
« no previous file with comments | « chrome/browser/android/bookmarks/bookmarks_bridge.cc ('k') | chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698