xmloff/source/draw/shapeexport.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 94e505b9ffbeb1695393d5dea0da84a0bf887fba
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Apr 17 19:25:26 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Apr 18 07:51:55 2023 +0200

    no need to perform lookup twice in XMLShapeExport::seekShapes
    
    Change-Id: I833da530fdc43233e14482a17a60beadb6ef6043
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150530
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index 056c3ce98267..94b7ad8e78a0 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1092,11 +1092,9 @@ void XMLShapeExport::seekShapes( const uno::Reference< 
drawing::XShapes >& xShap
         maCurrentShapesIter = maShapesInfos.find( xShapes );
         if( maCurrentShapesIter == maShapesInfos.end() )
         {
-            ImplXMLShapeExportInfoVector aNewInfoVector;
-            aNewInfoVector.resize( 
static_cast<ShapesInfos::size_type>(xShapes->getCount()) );
-            maShapesInfos[ xShapes ] = aNewInfoVector;
+            auto itPair = maShapesInfos.emplace( xShapes, 
ImplXMLShapeExportInfoVector( 
static_cast<ShapesInfos::size_type>(xShapes->getCount()) ) );
 
-            maCurrentShapesIter = maShapesInfos.find( xShapes );
+            maCurrentShapesIter = itPair.first;
 
             SAL_WARN_IF( maCurrentShapesIter == maShapesInfos.end(), "xmloff", 
"XMLShapeExport::seekShapes(): insert into stl::map failed" );
         }

Reply via email to