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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

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/ui/cocoa/bookmarks/bookmark_bar_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index bbcdb1f4794669d81d99849c412f5dd6788fd76b..f06bf77cb6adc2bdd345eb1e516ee3c6c8df4642 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -2483,11 +2483,8 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
- (void)didDragBookmarkToTrash:(BookmarkButton*)button {
if ([self canDragBookmarkButtonToTrash:button]) {
const BookmarkNode* node = [button bookmarkNode];
- if (node) {
- const BookmarkNode* parent = node->parent();
- bookmarkModel_->Remove(parent,
- parent->GetIndexOf(node));
- }
+ if (node)
+ bookmarkModel_->Remove(node);
}
}

Powered by Google App Engine
This is Rietveld 408576698