use insert function instead of for loop

Change-Id: Iee9dd7faee476642a19349f68191904207be3c3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178395
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
Manish
2024-12-13 12:33:58 +05:30
committed by Ilmari Lauhakangas
parent aa91f149b1
commit 5347fc1874

View File

@@ -136,12 +136,8 @@ private:
static void lcl_GetSortedRanges( const ScRangeList& rRangeList, ScRangeList& rRangeListOut )
{
rRangeListOut.RemoveAll();
std::vector<ScRange> aRanges;
size_t nSize = rRangeList.size();
aRanges.reserve( nSize );
aRanges.insert(aRanges.end(), rRangeList.begin(), rRangeList.end());
std::sort( aRanges.begin(), aRanges.end() );
rRangeListOut.insert(rRangeListOut.end(), aRanges.begin(), aRanges.end());
rRangeListOut.insert(rRangeListOut.end(), rRangeList.begin(), rRangeList.end());
std::sort(rRangeListOut.begin(), rRangeListOut.end());
}
void Test::testSimpleMark( const ScRange& rRange, const ScRange& rSelectionCover,