diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-15 10:48:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-15 12:04:31 +0100 |
commit | d0e848dab096160b16c4778ba25a40d1e5ff82af (patch) | |
tree | fec4a155c91994a19aa3b13599749a2563329685 /oox/source/export | |
parent | def8f7699661f3ca9d763b6bd5e81759cf5b4e12 (diff) |
avoid double map lookup
Change-Id: I02018eaaf220c7835756eba6215425bac9cbc6f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159432
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/source/export')
-rw-r--r-- | oox/source/export/drawingml.cxx | 5 | ||||
-rw-r--r-- | oox/source/export/vmlexport.cxx | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index ebe1df3a72d8..4bce89943ba3 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4320,8 +4320,9 @@ void DrawingML::WritePresetShape( const OString& pShape, MSO_SPT eShapeType, boo static std::map< OString, std::vector<OString> > aAdjMap = lcl_getAdjNames(); // If there are predefined adj names for this shape type, look them up now. std::vector<OString> aAdjustments; - if (aAdjMap.find(pShape) != aAdjMap.end()) - aAdjustments = aAdjMap[pShape]; + auto it = aAdjMap.find(pShape); + if (it != aAdjMap.end()) + aAdjustments = it->second; mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape); mpFS->startElementNS(XML_a, XML_avLst); diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 2ed2903bfe27..cfaa815aa964 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -1236,8 +1236,9 @@ static OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject) if (xShape->getPropertySetInfo()->hasPropertyByName("InteropGrabBag")) { comphelper::SequenceAsHashMap aInteropGrabBag(xShape->getPropertyValue("InteropGrabBag")); - if (aInteropGrabBag.find("AnchorId") != aInteropGrabBag.end()) - aInteropGrabBag["AnchorId"] >>= aResult; + auto it = aInteropGrabBag.find("AnchorId"); + if (it != aInteropGrabBag.end()) + it->second >>= aResult; } return aResult; |