diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-04-26 08:41:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-28 08:23:04 +0200 |
commit | a33922e38b87db5b009986324c6543e90f18a752 (patch) | |
tree | 9c0d80bd1c55677efa6e3241fd3d6107c6c58c0c /svx | |
parent | 2eb3922750b385dcadfd124d7baf686cec40eb5e (diff) |
optimise find/insert calls to maps
Instead of doing two lookups, we can just call insert and
then update the mapped-to value if the insert actually succeeded.
Change-Id: I3df3b98f0debe6bf74c739dd5850e7714d9c2789
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151030
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/framelinkarray.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 322e2225d5e6..918aa76dc7ae 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -1379,10 +1379,10 @@ drawinglayer::primitive2d::Primitive2DContainer Array::CreateB2DPrimitiveRange( GetMergedRange(nColLeft, nRowTop, nColRight, nRowBottom, nCol, nRow); const sal_Int32 nIndexOfMergedCell(mxImpl->GetIndex(nColLeft, nRowTop)); - if(aMergedCells.end() == aMergedCells.find(nIndexOfMergedCell)) + auto aItInsertedPair = aMergedCells.insert(nIndexOfMergedCell); + if(aItInsertedPair.second) { - // not found, so not yet handled. Add now to mark as handled - aMergedCells.insert(nIndexOfMergedCell); + // not found, so not yet handled. // Get and check if diagonal styles are used // Note: For GetCellStyleBLTR below I tried to use nRowBottom |