Index: base/test/histogram_tester.cc |
diff --git a/base/test/histogram_tester.cc b/base/test/histogram_tester.cc |
index 051f599f45a360f7afc31f897c051260a34fecde..09b4ef30ee3aa6863014db96e136b11b7274ca30 100644 |
--- a/base/test/histogram_tester.cc |
+++ b/base/test/histogram_tester.cc |
@@ -79,11 +79,13 @@ std::vector<Bucket> HistogramTester::GetAllSamples( |
std::vector<Bucket> samples; |
scoped_ptr<HistogramSamples> snapshot = |
GetHistogramSamplesSinceCreation(name); |
- for (auto it = snapshot->Iterator(); !it->Done(); it->Next()) { |
- HistogramBase::Sample sample; |
- HistogramBase::Count count; |
- it->Get(&sample, nullptr, &count); |
- samples.push_back(Bucket(sample, count)); |
+ if (snapshot) { |
Ilya Sherman
2015/08/07 17:20:12
optional nit: I'd write this as an early return, p
twifkak
2015/08/07 19:36:38
Hmm. Was going to do this, but on second thought,
|
+ for (auto it = snapshot->Iterator(); !it->Done(); it->Next()) { |
+ HistogramBase::Sample sample; |
+ HistogramBase::Count count; |
+ it->Get(&sample, nullptr, &count); |
+ samples.push_back(Bucket(sample, count)); |
+ } |
} |
return samples; |
} |