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

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm

Issue 2945803002: Use ContainsValue() instead of std::find() in ios/ (Closed)
Patch Set: Fixed compilation error. Created 3 years, 6 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: ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm b/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm
index 28cc755dbb44cc7bc27c3d588966e6491437fb92..1b94c600fc66c15b669c565d0353ab8a3a00dc4f 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/mac/bind_objc_block.h"
#include "base/mac/foundation_util.h"
+#include "base/stl_util.h"
#include "base/strings/sys_string_conversions.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_model_observer.h"
@@ -445,9 +446,7 @@ const NSTimeInterval kShowEmptyBookmarksBackgroundRefreshDelay = 1.0;
}
// A subfolder's children changed. Reload that cell.
- std::vector<const BookmarkNode*>::iterator it =
- std::find(_subFolders.begin(), _subFolders.end(), bookmarkNode);
- if (it != _subFolders.end()) {
+ if (base::ContainsValue(_subFolders, bookmarkNode)) {
// TODO(crbug.com/603661): Ideally, we would only reload the relevant index
// path. However, calling reloadItemsAtIndexPaths:(0,0) immediately after
// reloadData results in a exception: NSInternalInconsistencyException

Powered by Google App Engine
This is Rietveld 408576698