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

Unified Diff: device/bluetooth/dbus/fake_bluetooth_device_client.cc

Issue 2935673002: Use ContainsValue() instead of std::find() in device/bluetooth and device/hid (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 | « device/bluetooth/bluez/bluetooth_bluez_unittest.cc ('k') | device/hid/hid_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/dbus/fake_bluetooth_device_client.cc
diff --git a/device/bluetooth/dbus/fake_bluetooth_device_client.cc b/device/bluetooth/dbus/fake_bluetooth_device_client.cc
index 4f0243de137cf02b6c0f0cf409886aea2197b029..ae73a84fd298aeef66ee03a7e41eb0bc3936ef78 100644
--- a/device/bluetooth/dbus/fake_bluetooth_device_client.cc
+++ b/device/bluetooth/dbus/fake_bluetooth_device_client.cc
@@ -671,8 +671,7 @@ void FakeBluetoothDeviceClient::SetSimulationIntervalMs(int interval_ms) {
void FakeBluetoothDeviceClient::CreateDevice(
const dbus::ObjectPath& adapter_path,
const dbus::ObjectPath& device_path) {
- if (std::find(device_list_.begin(), device_list_.end(), device_path) !=
- device_list_.end())
+ if (base::ContainsValue(device_list_, device_path))
return;
std::unique_ptr<Properties> properties(
@@ -807,8 +806,7 @@ void FakeBluetoothDeviceClient::CreateDeviceWithProperties(
const dbus::ObjectPath& adapter_path,
const IncomingDeviceProperties& props) {
dbus::ObjectPath device_path(props.device_path);
- if (std::find(device_list_.begin(), device_list_.end(), device_path) !=
- device_list_.end())
+ if (base::ContainsValue(device_list_, device_path))
return;
std::unique_ptr<Properties> properties(
@@ -1821,8 +1819,7 @@ void FakeBluetoothDeviceClient::CreateTestDevice(
base::Base64Encode(base::RandBytesAsString(10), &id);
base::RemoveChars(id, "+/=", &id);
device_path = dbus::ObjectPath(adapter_path.value() + "/dev" + id);
- } while (std::find(device_list_.begin(), device_list_.end(), device_path) !=
- device_list_.end());
+ } while (base::ContainsValue(device_list_, device_path));
std::unique_ptr<Properties> properties(
new Properties(base::Bind(&FakeBluetoothDeviceClient::OnPropertyChanged,
« no previous file with comments | « device/bluetooth/bluez/bluetooth_bluez_unittest.cc ('k') | device/hid/hid_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698