From e8e1b81177756e6b310e2b1c68d6c879a3aeaa53 Mon Sep 17 00:00:00 2001 From: "Julien \"_FrnchFrgg_\" RIVAUD" Date: Sun, 20 Aug 2017 16:18:58 +0200 Subject: [PATCH] Use DataType iteration instead of assuming integers --- libs/ardour/ardour/chan_count.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h index 94c8b4ed06..faa452d886 100644 --- a/libs/ardour/ardour/chan_count.h +++ b/libs/ardour/ardour/chan_count.h @@ -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; -- 2.30.2