Index: chromeos/geolocation/simple_geolocation_provider.cc |
diff --git a/chromeos/geolocation/simple_geolocation_provider.cc b/chromeos/geolocation/simple_geolocation_provider.cc |
index 5ece69d46785903687fe640a86c5ea94a0f186d3..4a57ac7919bfac41ed4dc7a608b5b098650ff479 100644 |
--- a/chromeos/geolocation/simple_geolocation_provider.cc |
+++ b/chromeos/geolocation/simple_geolocation_provider.cc |
@@ -62,13 +62,10 @@ |
callback.Run(geoposition, server_error, elapsed); |
- ScopedVector<SimpleGeolocationRequest>::iterator position = |
- std::find(requests_.begin(), requests_.end(), request); |
- DCHECK_NE(&(*position), &(*requests_.end())); |
- if (position != requests_.end()) { |
- std::swap(*position, *requests_.rbegin()); |
- requests_.resize(requests_.size() - 1); |
- } |
+ ScopedVector<SimpleGeolocationRequest>::iterator new_end = |
+ std::remove(requests_.begin(), requests_.end(), request); |
+ DCHECK_EQ(std::distance(new_end, requests_.end()), 1); |
+ requests_.erase(new_end, requests_.end()); |
} |
} // namespace chromeos |