summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/histogram.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/base/histogram.cc b/base/histogram.cc
index 31cc6a5..896867f 100644
--- a/base/histogram.cc
+++ b/base/histogram.cc
@@ -819,10 +819,9 @@ void StatisticsRecorder::Register(Histogram* histogram) {
return;
const std::string name = histogram->histogram_name();
AutoLock auto_lock(*lock_);
- DCHECK(histograms_->end() == histograms_->find(name));
-
- (*histograms_)[name] = histogram;
- return;
+ // Avoid overwriting a previous registration.
+ if (histograms_->end() == histograms_->find(name))
+ (*histograms_)[name] = histogram;
}
// static