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

Unified Diff: device/bluetooth/test/mock_bluetooth_gatt_service.cc

Issue 2614753004: Remove ScopedVector from bluetooth. (Closed)
Patch Set: last win bits Created 3 years, 11 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/test/mock_bluetooth_gatt_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/mock_bluetooth_gatt_service.cc
diff --git a/device/bluetooth/test/mock_bluetooth_gatt_service.cc b/device/bluetooth/test/mock_bluetooth_gatt_service.cc
index 800de2e4c4927c584ecd57915dac1d03befb702d..5533f2175abf35bf9d42e3b77bc544a184bb4315 100644
--- a/device/bluetooth/test/mock_bluetooth_gatt_service.cc
+++ b/device/bluetooth/test/mock_bluetooth_gatt_service.cc
@@ -45,22 +45,19 @@ void MockBluetoothGattService::AddMockCharacteristic(
std::vector<BluetoothRemoteGattCharacteristic*>
MockBluetoothGattService::GetMockCharacteristics() const {
std::vector<BluetoothRemoteGattCharacteristic*> characteristics;
- for (BluetoothRemoteGattCharacteristic* characteristic :
- mock_characteristics_) {
- characteristics.push_back(characteristic);
- }
+ for (const auto& characteristic : mock_characteristics_)
+ characteristics.push_back(characteristic.get());
+
return characteristics;
}
BluetoothRemoteGattCharacteristic*
MockBluetoothGattService::GetMockCharacteristic(
const std::string& identifier) const {
- for (BluetoothRemoteGattCharacteristic* characteristic :
- mock_characteristics_) {
- if (characteristic->GetIdentifier() == identifier) {
- return characteristic;
- }
- }
+ for (const auto& characteristic : mock_characteristics_)
+ if (characteristic->GetIdentifier() == identifier)
+ return characteristic.get();
+
return nullptr;
}
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_gatt_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698