pfultz2/cppcheck

StlAlgorithm: std::accumulate with counter

pfultz2 opened this issue · 1 comments

This can use std::accumulate when using a RandomAccess range:

        for(auto&& x : v)
        {
            if (i != axis)
                y *= x;
            i++;
        }

And also this:

        for (auto&& x : v)
        {
            if (i > axis)
                y1 *= x;
            if (i != axis)
                y1 *= x;
            i++;
        }