Commit 4cf4e0fe authored by Hwanseung Lee's avatar Hwanseung Lee Committed by Commit Bot

Use ContainsValue() instead of std::find() at components -4-

replace std::find() with base::containsValue()
at components/bookmarks and components/exo
and components/infobars

Bug: 561800
Change-Id: I9b2cb633e6872e37663a249fba77548a074d9e02
Reviewed-on: https://chromium-review.googlesource.com/1124719Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Hwanseung Lee <hs1217.lee@samsung.com>
Cr-Commit-Position: refs/heads/master@{#573562}
parent ef327551
......@@ -19,6 +19,7 @@
#include "base/files/scoped_temp_dir.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
......@@ -1358,8 +1359,7 @@ class BookmarkModelFaviconTest : public testing::Test,
}
bool WasNodeUpdated(const BookmarkNode* node) {
return std::find(updated_nodes_.begin(), updated_nodes_.end(), node) !=
updated_nodes_.end();
return base::ContainsValue(updated_nodes_, node);
}
void ClearUpdatedNodes() {
......
......@@ -15,6 +15,7 @@
#include "base/i18n/string_search.h"
#include "base/macros.h"
#include "base/metrics/user_metrics_action.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
......@@ -374,7 +375,7 @@ std::vector<const BookmarkNode*> GetMostRecentlyModifiedUserFolders(
for (int i = 0; i < root_node->child_count(); ++i) {
const BookmarkNode* node = root_node->GetChild(i);
if (node->IsVisible() && model->client()->CanBeEditedByUser(node) &&
std::find(nodes.begin(), nodes.end(), node) == nodes.end()) {
!base::ContainsValue(nodes, node)) {
nodes.push_back(node);
if (nodes.size() == max_count)
......
......@@ -12,6 +12,7 @@
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_storage.h"
......@@ -51,8 +52,7 @@ void TestBookmarkClient::SetExtraNodesToLoad(
}
bool TestBookmarkClient::IsExtraNodeRoot(const BookmarkNode* node) {
return std::find(unowned_extra_nodes_.begin(), unowned_extra_nodes_.end(),
node) != unowned_extra_nodes_.end();
return base::ContainsValue(unowned_extra_nodes_, node);
}
bool TestBookmarkClient::IsAnExtraNode(const BookmarkNode* node) {
......
......@@ -5,6 +5,7 @@
#include "components/exo/layer_tree_frame_sink_holder.h"
#include "ash/shell.h"
#include "base/stl_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "cc/trees/layer_tree_frame_sink.h"
#include "components/exo/surface_tree_host.h"
......@@ -124,8 +125,7 @@ void LayerTreeFrameSinkHolder::ReclaimResources(
for (auto& resource : resources) {
// Skip resources that are also in last frame. This can happen if
// the frame sink id changed.
if (std::find(last_frame_resources_.begin(), last_frame_resources_.end(),
resource.id) != last_frame_resources_.end()) {
if (base::ContainsValue(last_frame_resources_, resource.id)) {
continue;
}
auto it = release_callbacks_.find(resource.id);
......
......@@ -11,6 +11,7 @@
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/metrics_hashes.h"
#include "base/stl_util.h"
#include "build/build_config.h"
#include "components/infobars/core/infobar.h"
#include "components/infobars/core/infobar_delegate.h"
......@@ -123,8 +124,7 @@ void InfoBarContainer::OnManagerShuttingDown(InfoBarManager* manager) {
void InfoBarContainer::AddInfoBar(InfoBar* infobar,
size_t position,
bool animate) {
DCHECK(std::find(infobars_.begin(), infobars_.end(), infobar) ==
infobars_.end());
DCHECK(!base::ContainsValue(infobars_, infobar));
DCHECK_LE(position, infobars_.size());
infobars_.insert(infobars_.begin() + position, infobar);
PlatformSpecificAddInfoBar(infobar, position);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment