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

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: Updated as per latest code Created 4 years, 8 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 | « chrome/renderer/spellchecker/spellcheck.cc ('k') | chrome/test/chromedriver/commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck.cc ('k') | chrome/test/chromedriver/commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698