mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-16 00:46:03 +08:00
Fix histogram indexing when accessed via operator [] (#939)
This commit is contained in:
parent
211b8c2e90
commit
f01edbc5c4
@ -249,7 +249,7 @@ namespace etl
|
||||
//*********************************
|
||||
value_type operator [](key_type key) const
|
||||
{
|
||||
return this->accumulator[key];
|
||||
return this->accumulator[key - Start_Index];
|
||||
}
|
||||
};
|
||||
|
||||
@ -373,7 +373,7 @@ namespace etl
|
||||
//*********************************
|
||||
value_type operator [](key_type key) const
|
||||
{
|
||||
return this->accumulator[key];
|
||||
return this->accumulator[key - start_index];
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@ -247,7 +247,7 @@ namespace
|
||||
|
||||
for (size_t i = 0UL; i < output1.size(); ++i)
|
||||
{
|
||||
CHECK_EQUAL(int(output1[i]), int(histogram[i]));
|
||||
CHECK_EQUAL(int(output1[i]), int(histogram[i - 4]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user