Index: chromecast/base/observer.h |
diff --git a/chromecast/base/observer.h b/chromecast/base/observer.h |
index a1b6d48f39ac36e6c196086c67a78489f954ccf7..8aa5af3d86f328b7071131b85a53d64c9fee2f48 100644 |
--- a/chromecast/base/observer.h |
+++ b/chromecast/base/observer.h |
@@ -114,6 +114,7 @@ |
#include "base/memory/ref_counted.h" |
#include "base/sequence_checker.h" |
#include "base/sequenced_task_runner.h" |
+#include "base/stl_util.h" |
#include "base/synchronization/lock.h" |
#include "base/threading/sequenced_task_runner_handle.h" |
@@ -266,16 +267,14 @@ class ObservableInternals |
void AddObserver(Observer<T>* observer) { |
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
DCHECK(observer); |
- DCHECK(std::find(observers_.begin(), observers_.end(), observer) == |
- observers_.end()); |
+ DCHECK(!base::ContainsValue(observers_, observer)); |
observers_.push_back(observer); |
} |
void RemoveObserver(Observer<T>* observer) { |
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
DCHECK(observer); |
- DCHECK(std::find(observers_.begin(), observers_.end(), observer) != |
- observers_.end()); |
+ DCHECK(base::ContainsValue(observers_, observer)); |
observers_.erase( |
std::remove(observers_.begin(), observers_.end(), observer), |
observers_.end()); |