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; |
} |