Use DataType iteration instead of assuming integers
This commit is contained in:
parent
5f2132e9cc
commit
e8e1b81177
@ -91,15 +91,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
uint32_t n_total() const {
|
uint32_t n_total() const {
|
||||||
uint32_t ret = 0;
|
uint32_t ret = 0;
|
||||||
for (uint32_t i=0; i < DataType::num_types; ++i)
|
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t)
|
||||||
ret += _counts[i];
|
ret += _counts[*t];
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ChanCount& other) const {
|
bool operator==(const ChanCount& other) const {
|
||||||
for (uint32_t i=0; i < DataType::num_types; ++i)
|
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t)
|
||||||
if (_counts[i] != other._counts[i])
|
if (_counts[*t] != other._counts[*t])
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user