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

Unified Diff: ui/views/layout/grid_layout.cc

Issue 2930573005: Use ContainsValue() instead of std::find() in ui/android, ui/base and ui/views (Closed)
Patch Set: Changed EXPECT_FALSE to EXPECT_TRUE 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
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/layout/grid_layout.cc
diff --git a/ui/views/layout/grid_layout.cc b/ui/views/layout/grid_layout.cc
index 345f35fa05a2400bca79d9ba1eaf4ed126d1c51f..eff652752baca228fbc5581584b8b77fbfb457d2 100644
--- a/ui/views/layout/grid_layout.cc
+++ b/ui/views/layout/grid_layout.cc
@@ -4,11 +4,10 @@
#include "ui/views/layout/grid_layout.h"
-#include <algorithm>
-
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/stl_util.h"
#include "ui/views/border.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/view.h"
@@ -485,9 +484,7 @@ void ColumnSet::AccumulateMasterColumns() {
DCHECK(master_columns_.empty());
for (const auto& column : columns_) {
Column* master_column = column->GetLastMasterColumn();
- if (master_column &&
- std::find(master_columns_.begin(), master_columns_.end(),
- master_column) == master_columns_.end()) {
+ if (master_column && !base::ContainsValue(master_columns_, master_column)) {
master_columns_.push_back(master_column);
}
// At this point, GetLastMasterColumn may not == master_column
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698