summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-08 21:11:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-08 22:17:59 +0200
commit993ae97e38e72e9d5dabeb0f3abafdc55c73161e (patch)
tree1f45717cf11398090f83aa5aab9eac1248bfc03e /sc/source
parent2cf4cf718165988e81b606be7fa0a4b02973a10a (diff)
avoid double-lookup
this is hot when creating charts Change-Id: Ic096d9293a48d53fc2cadfda95b5b7a13ba16f68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121830 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 5efa562cb352..3ee4f1cde054 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -760,12 +760,13 @@ void Chart2Positioner::createPositionMap()
aCellData.SetAbsRow(nRow);
aCellData.SetAbsTab(nTab);
- if (rCol.find(nInsRow) == rCol.end())
+ auto& rCell = rCol[nInsRow];
+ if (!rCell)
{
if (bExternal)
- rCol[ nInsRow ].reset(new ScExternalSingleRefToken(nFileId, aTabName, aCellData));
+ rCell.reset(new ScExternalSingleRefToken(nFileId, aTabName, aCellData));
else
- rCol[ nInsRow ].reset(new ScSingleRefToken(mpDoc->GetSheetLimits(), aCellData));
+ rCell.reset(new ScSingleRefToken(mpDoc->GetSheetLimits(), aCellData));
}
}
}