From 1f9468fc29874eae5100317282ab8b395904406d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 14 Oct 2021 14:57:54 +0200 Subject: use std::vector::insert instead of push_back because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin --- forms/source/component/ComboBox.cxx | 3 +-- forms/source/xforms/binding.cxx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'forms') diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 9b1bd9b9c7bd..fe3260070d68 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -632,8 +632,7 @@ void OComboBoxModel::loadData( bool _bForce ) if (xFieldNames.is()) { const Sequence aFieldNames = xFieldNames->getElementNames(); - for (const OUString& rustrNames : aFieldNames) - aStringList.push_back(rustrNames); + aStringList.insert(aStringList.end(), aFieldNames.begin(), aFieldNames.end()); } } break; diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index 3b6983f05daf..6d8735f6366c 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -552,8 +552,7 @@ void Binding::bind( bool bForceRebind ) lcl_removeListenerFromNode( eventNode, this ); maEventNodes.clear(); if( isSimpleBinding() ) - for (auto const& node : aNodes) - maEventNodes.push_back(node); + maEventNodes.insert(maEventNodes.end(), aNodes.begin(), aNodes.end()); else maEventNodes.emplace_back( aContext.mxContextNode->getOwnerDocument(), UNO_QUERY_THROW ); -- cgit