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

Unified Diff: ui/base/models/list_selection_model.cc

Issue 2930573005: Use ContainsValue() instead of std::find() in ui/android, ui/base and ui/views (Closed)
Patch Set: Removed #include <algorithm> from clipboard.cc 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: ui/base/models/list_selection_model.cc
diff --git a/ui/base/models/list_selection_model.cc b/ui/base/models/list_selection_model.cc
index 5b9fc86db5fc6ec5254b14a1668af9c380dfdb6a..0226ac7d85cc227db6e37fca8a067430260a254a 100644
--- a/ui/base/models/list_selection_model.cc
+++ b/ui/base/models/list_selection_model.cc
@@ -8,6 +8,7 @@
#include <valarray>
#include "base/logging.h"
+#include "base/stl_util.h"
namespace ui {
@@ -67,8 +68,7 @@ void ListSelectionModel::SetSelectedIndex(int index) {
}
bool ListSelectionModel::IsSelected(int index) const {
- return std::find(selected_indices_.begin(), selected_indices_.end(), index) !=
- selected_indices_.end();
+ return base::ContainsValue(selected_indices_, index);
}
void ListSelectionModel::AddIndexToSelection(int index) {

Powered by Google App Engine
This is Rietveld 408576698