[Libreoffice-commits] core.git: svx/source
Julien Nabet
serval2412 at yahoo.fr
Tue Jan 2 14:56:18 UTC 2018
svx/source/table/tablemodel.cxx | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
New commits:
commit e7fd8ee57c69e676ec622d13212ab3b3091c1a2d
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sun Dec 31 16:44:52 2017 +0100
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 at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index bbe6c42edebd..4d6a558a3622 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -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);
}
}
}
More information about the Libreoffice-commits
mailing list