Remove name parameter from HistogramAdd function.

This name is only used for a DCHECK. Having it as a parameter leads to unnecessary string copying even on release builds.

This CL instead adds a GetHistogramName function that is only called on debug builds.

Checking if pointer is null is also moved outside HistogramAdd function. Having it there is confusing since Chromium implementation doesn't have it there.

BUG=webrtc:6329

Review-Url: https://codereview.webrtc.org/2337883003
Cr-Commit-Position: refs/heads/master@{#14263}
This commit is contained in:
sakal
2016-09-16 06:56:15 -07:00
committed by Commit bot
parent a6974d7f7e
commit 71b8393b6a
4 changed files with 37 additions and 41 deletions

View File

@ -55,9 +55,6 @@ int NumSamples(const std::string& name);
// Returns the minimum sample value (or -1 if the histogram has no samples).
int MinSample(const std::string& name);
// Function for adding a |sample| to a histogram without checkking the name.
void HistogramAdd(Histogram* histogram_pointer, int sample);
} // namespace metrics
} // namespace webrtc