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

Unified Diff: ui/display/win/screen_win.cc

Issue 2926383003: Use ContainsValue() instead of std::find() in ui/aura, ui/display and ui/events (Closed)
Patch Set: 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/display/manager/managed_display_info.cc ('k') | ui/events/event_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/win/screen_win.cc
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc
index 5ad877e2bb61bf9949e4a051b13dbc9012b6675c..8b436cc26f9f47b78d034ef942ea04c7745a969c 100644
--- a/ui/display/win/screen_win.cc
+++ b/ui/display/win/screen_win.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/metrics/histogram_macros.h"
+#include "base/stl_util.h"
#include "base/win/win_util.h"
#include "ui/display/display.h"
#include "ui/display/display_layout.h"
@@ -590,8 +591,7 @@ void ScreenWin::RecordDisplayScaleFactors() const {
// it so that if it's wildly out-of-band we won't send it to the backend.
const int reported_scale = std::min(
std::max(base::checked_cast<int>(scale_factor * 100), 0), 1000);
- if (std::find(unique_scale_factors.begin(), unique_scale_factors.end(),
- reported_scale) == unique_scale_factors.end()) {
+ if (!base::ContainsValue(unique_scale_factors, reported_scale)) {
unique_scale_factors.push_back(reported_scale);
UMA_HISTOGRAM_SPARSE_SLOWLY("UI.DeviceScale", reported_scale);
}
« no previous file with comments | « ui/display/manager/managed_display_info.cc ('k') | ui/events/event_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698