Kaydet (Commit) e7fd8ee5 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Noel Grandin

cppcheck: fix prefer ++/-- for non primitive types

Here, we can just initialize the iterators with the right increment
instead of using while loops to increment them

Change-Id: I08b51ba11398dbb705d3ed83bfbf46df0deb7f21
Reviewed-on: https://gerrit.libreoffice.org/47224Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1e83e713
......@@ -67,21 +67,7 @@ template< class Vec, class Iter > void remove_range( Vec& rVector, sal_Int32 nIn
}
else
{
Iter aBegin( rVector.begin() );
while( nIndex-- )
aBegin++;
if( nCount == 1 )
{
rVector.erase( aBegin );
}
else
{
Iter aEnd( aBegin );
while( nCount-- )
aEnd++;
rVector.erase( aBegin, aEnd );
}
rVector.erase(rVector.begin() + nIndex, rVector.begin() + nIndex + nCount);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment