pfultz2/cppcheck

Diagnostic when looping after a container is checked

Opened this issue · 1 comments

We should warn for:

if(!v.empty())
{
    for(auto x:v)
    {}
}

Also we should also warn for this:

if(n > 0)
{
    for(int i = 0;i < n;i++) {}
}