Index: cc/debug/micro_benchmark_controller_impl.cc |
diff --git a/cc/debug/micro_benchmark_controller_impl.cc b/cc/debug/micro_benchmark_controller_impl.cc |
index 821ba5f8d4493c6cacc7d5483937a5bc60e4475e..2cd1a796c708598b7a846319888be3dced4a6bef 100644 |
--- a/cc/debug/micro_benchmark_controller_impl.cc |
+++ b/cc/debug/micro_benchmark_controller_impl.cc |
@@ -12,20 +12,6 @@ |
namespace cc { |
-namespace { |
- |
-class IsDonePredicate { |
- public: |
- typedef const MicroBenchmarkImpl* argument_type; |
- typedef bool result_type; |
- |
- result_type operator()(argument_type benchmark) const { |
- return benchmark->IsDone(); |
- } |
-}; |
- |
-} // namespace |
- |
MicroBenchmarkControllerImpl::MicroBenchmarkControllerImpl( |
LayerTreeHostImpl* host) |
: host_(host) { |
@@ -40,9 +26,9 @@ void MicroBenchmarkControllerImpl::ScheduleRun( |
} |
void MicroBenchmarkControllerImpl::DidCompleteCommit() { |
- for (ScopedPtrVector<MicroBenchmarkImpl>::iterator it = benchmarks_.begin(); |
- it != benchmarks_.end(); |
- ++it) { |
+ for (std::vector<scoped_ptr<MicroBenchmarkImpl>>::iterator it = |
danakj
2015/11/17 01:12:17
auto, ranged-based
vmpstr
2015/11/17 23:26:23
Done.
|
+ benchmarks_.begin(); |
+ it != benchmarks_.end(); ++it) { |
DCHECK(!(*it)->IsDone()); |
(*it)->DidCompleteCommit(host_); |
} |
@@ -52,7 +38,10 @@ void MicroBenchmarkControllerImpl::DidCompleteCommit() { |
void MicroBenchmarkControllerImpl::CleanUpFinishedBenchmarks() { |
benchmarks_.erase( |
- benchmarks_.partition(std::not1(IsDonePredicate())), |
+ std::remove_if(benchmarks_.begin(), benchmarks_.end(), |
+ [](const scoped_ptr<MicroBenchmarkImpl>& benchmark) { |
+ return benchmark->IsDone(); |
danakj
2015/11/17 01:12:17
did you mean the inverse?
vmpstr
2015/11/17 23:26:23
Nope :)
|
+ }), |
benchmarks_.end()); |
} |