Add a size check on the smoother iteration
This commit is contained in:
parent
3b5f215a10
commit
d818b0d7c8
1 changed files with 3 additions and 1 deletions
|
|
@ -392,9 +392,11 @@ private:
|
||||||
template <class F>
|
template <class F>
|
||||||
void forEachWithSmoother(sfz::Mod modId, F&& lambda)
|
void forEachWithSmoother(sfz::Mod modId, F&& lambda)
|
||||||
{
|
{
|
||||||
|
size_t count = region->modifiers[modId].size();
|
||||||
|
ASSERT(count == modifierSmoothers[modId].size());
|
||||||
auto mod = region->modifiers[modId].begin();
|
auto mod = region->modifiers[modId].begin();
|
||||||
auto smoother = modifierSmoothers[modId].begin();
|
auto smoother = modifierSmoothers[modId].begin();
|
||||||
while (mod < region->modifiers[modId].end()) {
|
for (size_t i = 0; i < count; ++i) {
|
||||||
lambda(*mod, *smoother);
|
lambda(*mod, *smoother);
|
||||||
incrementAll(mod, smoother);
|
incrementAll(mod, smoother);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue