basic: workaround MSVC compiler bug with post-increment operator (#1939)

Prevent the compiler from optimizing away initialization loops
This commit is contained in:
Sreelakshmi Haridas Maruthur
2024-05-21 09:47:47 -06:00
committed by GitHub
parent b377b8537b
commit 5ce18c3f5a

View File

@@ -516,8 +516,7 @@ static void makeReference(std::vector<T>& ref)
// single channel lvalue
for (size_t i = 0; i < N; i++)
{
ref[dstIndex * S + i] = 0;
++dstIndex;
ref[dstIndex++ * S + i] = 0;
}
// normal lvalue