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

Unified Diff: chrome/test/chromedriver/chrome/device_manager.cc

Issue 1715683002: chrome: Use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing non ContainsValue changes Created 4 years, 9 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: chrome/test/chromedriver/chrome/device_manager.cc
diff --git a/chrome/test/chromedriver/chrome/device_manager.cc b/chrome/test/chromedriver/chrome/device_manager.cc
index c8c97365a6af2dfc98062a00fc1112f5e5317c64..5dafb42f5c6dc9159951f7f0a6741f0e30459fa0 100644
--- a/chrome/test/chromedriver/chrome/device_manager.cc
+++ b/chrome/test/chromedriver/chrome/device_manager.cc
@@ -11,6 +11,7 @@
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "chrome/test/chromedriver/chrome/adb.h"
@@ -182,7 +183,7 @@ Status DeviceManager::AcquireSpecificDevice(
if (status.IsError())
return status;
- if (std::find(devices.begin(), devices.end(), device_serial) == devices.end())
+ if (!ContainsValue(devices, device_serial))
return Status(kUnknownError,
"Device " + device_serial + " is not online");
@@ -210,6 +211,5 @@ Device* DeviceManager::LockDevice(const std::string& device_serial) {
}
bool DeviceManager::IsDeviceLocked(const std::string& device_serial) {
- return std::find(active_devices_.begin(), active_devices_.end(),
- device_serial) != active_devices_.end();
+ return ContainsValue(active_devices_, device_serial);
}

Powered by Google App Engine
This is Rietveld 408576698