Index: ios/chrome/browser/bookmarks/bookmarks_utils.cc |
diff --git a/ios/chrome/browser/bookmarks/bookmarks_utils.cc b/ios/chrome/browser/bookmarks/bookmarks_utils.cc |
index a7ece33186c047547a51343b61d6793d414e3911..82a8036cc6036ceccf554ba082b600439ae9dcd9 100644 |
--- a/ios/chrome/browser/bookmarks/bookmarks_utils.cc |
+++ b/ios/chrome/browser/bookmarks/bookmarks_utils.cc |
@@ -6,6 +6,7 @@ |
#include "base/logging.h" |
#include "base/metrics/histogram_macros.h" |
+#include "base/stl_util.h" |
#include "components/bookmarks/browser/bookmark_model.h" |
#include "components/prefs/pref_service.h" |
#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" |
@@ -72,11 +73,7 @@ std::vector<const BookmarkNode*> RootLevelFolders(BookmarkModel* model) { |
bool IsPrimaryPermanentNode(const BookmarkNode* node, BookmarkModel* model) { |
std::vector<const BookmarkNode*> primary_nodes(PrimaryPermanentNodes(model)); |
- if (std::find(primary_nodes.begin(), primary_nodes.end(), node) != |
- primary_nodes.end()) { |
- return true; |
- } |
- return false; |
+ return base::ContainsValue(primary_nodes, node); |
} |
const BookmarkNode* RootLevelFolderForNode(const BookmarkNode* node, |
@@ -88,9 +85,7 @@ const BookmarkNode* RootLevelFolderForNode(const BookmarkNode* node, |
const std::vector<const BookmarkNode*> root_folders(RootLevelFolders(model)); |
const BookmarkNode* top = node; |
- while (top && |
- std::find(root_folders.begin(), root_folders.end(), top) == |
- root_folders.end()) { |
+ while (top && !base::ContainsValue(root_folders, top)) { |
top = top->parent(); |
} |
return top; |