Chromium Code Reviews| Index: webrtc/base/analytics/percentile_filter.h |
| diff --git a/webrtc/base/analytics/percentile_filter.h b/webrtc/base/analytics/percentile_filter.h |
| index b3c8f8d1775f8df42b22b9a42d802ce454b9c1cb..e7486b747cd1819e7a326441f1b367224fb9a9af 100644 |
| --- a/webrtc/base/analytics/percentile_filter.h |
| +++ b/webrtc/base/analytics/percentile_filter.h |
| @@ -35,7 +35,7 @@ class PercentileFilter { |
| // Remove one observation. The complexity of this operation is logarithmic in |
| // the size of the container. |
|
stefan-webrtc
2016/11/28 13:01:58
Comment on what this returns
terelius
2016/12/02 16:45:52
Done.
|
| - void Erase(const T& value); |
| + bool Erase(const T& value); |
| // Get the percentile value. The complexity of this operation is constant. |
| T GetPercentileValue() const; |
| @@ -76,11 +76,11 @@ void PercentileFilter<T>::Insert(const T& value) { |
| } |
| template <typename T> |
| -void PercentileFilter<T>::Erase(const T& value) { |
| +bool PercentileFilter<T>::Erase(const T& value) { |
| typename std::multiset<T>::const_iterator it = set_.lower_bound(value); |
| // Ignore erase operation if the element is not present in the current set. |
| if (it == set_.end() || *it != value) |
| - return; |
| + return false; |
| if (it == percentile_it_) { |
| // If same iterator, update to the following element. Index is not |
| // affected. |
| @@ -92,6 +92,7 @@ void PercentileFilter<T>::Erase(const T& value) { |
| --percentile_index_; |
| } |
| UpdatePercentileIterator(); |
| + return true; |
| } |
| template <typename T> |