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

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

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: Mac bustage Created 4 years 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: 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..e0230f0423a8f950caf8e7b0fbfce85ce2b931b2 100644
--- a/device/bluetooth/test/mock_bluetooth_gatt_service.cc
+++ b/device/bluetooth/test/mock_bluetooth_gatt_service.cc
@@ -45,9 +45,8 @@ void MockBluetoothGattService::AddMockCharacteristic(
std::vector<BluetoothRemoteGattCharacteristic*>
MockBluetoothGattService::GetMockCharacteristics() const {
std::vector<BluetoothRemoteGattCharacteristic*> characteristics;
- for (BluetoothRemoteGattCharacteristic* characteristic :
- mock_characteristics_) {
- characteristics.push_back(characteristic);
+ for (auto& mock : mock_characteristics_) {
+ characteristics.push_back(mock.get());
}
return characteristics;
}
@@ -55,10 +54,9 @@ MockBluetoothGattService::GetMockCharacteristics() const {
BluetoothRemoteGattCharacteristic*
MockBluetoothGattService::GetMockCharacteristic(
const std::string& identifier) const {
- for (BluetoothRemoteGattCharacteristic* characteristic :
- mock_characteristics_) {
- if (characteristic->GetIdentifier() == identifier) {
- return characteristic;
+ for (auto& mock : mock_characteristics_) {
+ if (mock->GetIdentifier() == identifier) {
+ return mock.get();
}
}
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698