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/47224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
1e83e713b3
commit
e7fd8ee57c
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user