chart2/source/view/main/DataTableView.cxx                  |    4 +---
 extensions/source/propctrlr/listselectiondlg.cxx           |    3 +--
 framework/source/accelerators/acceleratorconfiguration.cxx |    6 ++----
 3 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 0f627ec0f012ef09f68377fade8495ab0895861d
Author:     Nicu <[email protected]>
AuthorDate: Sat Nov 29 01:18:11 2025 +0200
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Sat Nov 29 10:21:50 2025 +0100

    tdf#163738 Use insert() to add multiple values in containers instead of
    
    a loop
    
    Signed-off-by: Nicu <[email protected]>
    Change-Id: I484cabfe59e5896e9163120666191e6404647fce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194805
    Reviewed-by: Ilmari Lauhakangas <[email protected]>
    Tested-by: Jenkins

diff --git a/chart2/source/view/main/DataTableView.cxx 
b/chart2/source/view/main/DataTableView.cxx
index 274f4d3be90f..54a03f82adbe 100644
--- a/chart2/source/view/main/DataTableView.cxx
+++ b/chart2/source/view/main/DataTableView.cxx
@@ -370,9 +370,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& 
rStart, basegfx::B2DV
                 awt::Size aSize(nSymbolWidth, nSymbolHeight);
                 std::vector<ViewLegendSymbol> aNewEntries
                     = pSeriesPlotter->createSymbols(aSize, m_xTarget, 
m_xComponentContext);
-
-                for (auto const& rSymbol : aNewEntries)
-                    aSymbols.push_back(rSymbol);
+                aSymbols.insert(aSymbols.end(), aNewEntries.begin(), 
aNewEntries.end());
             }
         }
     }
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx 
b/extensions/source/propctrlr/listselectiondlg.cxx
index 22e0f746e518..c7b6f1ab9e8f 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -121,8 +121,7 @@ namespace pcr
         std::vector<sal_Int16> aRetSelection;
         auto aSelection = m_xEntries->get_selected_rows();
         aRetSelection.reserve(aSelection.size());
-        for (auto row : aSelection)
-            aRetSelection.push_back(row);
+        aRetSelection.insert(aRetSelection.end(), aSelection.begin(), 
aSelection.end());
         return aRetSelection;
     }
 
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx 
b/framework/source/accelerators/acceleratorconfiguration.cxx
index 27848a17f6ae..91b2d3d1b65e 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -490,8 +490,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL 
XCUBasedAcceleratorConfigurati
 
     AcceleratorCache::TKeyList lSecondaryKeys = 
impl_getCFG(false).getAllKeys(); //get keys from SecondaryKeys set
     lKeys.reserve(lKeys.size()+lSecondaryKeys.size());
-    for (auto const& secondaryKey : lSecondaryKeys)
-        lKeys.push_back(secondaryKey);
+    lKeys.insert(lKeys.end(), lSecondaryKeys.begin(), lSecondaryKeys.end());
 
     return comphelper::containerToSequence(lKeys);
 }
@@ -651,8 +650,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL 
XCUBasedAcceleratorConfigurati
     AcceleratorCache::TKeyList lKeys  = 
rPrimaryCache.getKeysByCommand(sCommand);
 
     AcceleratorCache::TKeyList lSecondaryKeys = 
rSecondaryCache.getKeysByCommand(sCommand);
-    for (auto const& secondaryKey : lSecondaryKeys)
-        lKeys.push_back(secondaryKey);
+    lKeys.insert(lKeys.end(), lSecondaryKeys.begin(), lSecondaryKeys.end());
 
     return comphelper::containerToSequence(lKeys);
 }

Reply via email to