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:
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user