mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 844146 - add BooleanHistogram::Accumulate to properly canonicalize values for boolean histograms; r=taras
This commit is contained in:
parent
979a076f41
commit
715a3df5d3
@ -973,6 +973,14 @@ BooleanHistogram::BooleanHistogram(const std::string& name)
|
||||
: LinearHistogram(name, 1, 2, 3) {
|
||||
}
|
||||
|
||||
void
|
||||
BooleanHistogram::Accumulate(Sample value, Count count, size_t index)
|
||||
{
|
||||
// Callers will have computed index based on the non-booleanified value.
|
||||
// So we need to adjust the index manually.
|
||||
LinearHistogram::Accumulate(!!value, count, value ? 1 : 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// FlagHistogram:
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -672,6 +672,8 @@ class BooleanHistogram : public LinearHistogram {
|
||||
|
||||
virtual void AddBoolean(bool value);
|
||||
|
||||
virtual void Accumulate(Sample value, Count count, size_t index);
|
||||
|
||||
protected:
|
||||
explicit BooleanHistogram(const std::string& name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user