13
0

Use DataType iteration instead of assuming integers

This commit is contained in:
Julien "_FrnchFrgg_" RIVAUD 2017-08-20 16:18:58 +02:00
parent 5f2132e9cc
commit e8e1b81177

View File

@ -91,15 +91,15 @@ public:
*/
uint32_t n_total() const {
uint32_t ret = 0;
for (uint32_t i=0; i < DataType::num_types; ++i)
ret += _counts[i];
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t)
ret += _counts[*t];
return ret;
}
bool operator==(const ChanCount& other) const {
for (uint32_t i=0; i < DataType::num_types; ++i)
if (_counts[i] != other._counts[i])
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t)
if (_counts[*t] != other._counts[*t])
return false;
return true;