summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-14 14:57:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-14 21:28:40 +0200
commit1f9468fc29874eae5100317282ab8b395904406d (patch)
tree7da605653b3a979d18c2283f42ac8a3efd9eae63 /xmloff
parent43b0d4f709a3a1446a32e36abb5deaa3bb45ddd9 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/txtparae.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 7257ac0061af..b444635af77e 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -537,8 +537,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily,
vector< XMLPropertyState > aPropStates =
xPropMapper->Filter(GetExport(), rPropSet);
- for (const XMLPropertyState& rState : aAddStates)
- aPropStates.push_back( rState );
+ aPropStates.insert( aPropStates.end(), aAddStates.begin(), aAddStates.end() );
if( aPropStates.empty() )
return;
@@ -759,8 +758,7 @@ OUString XMLTextParagraphExport::Find(
if( !xPropMapper.is() )
return sName;
vector<XMLPropertyState> aPropStates(xPropMapper->Filter(GetExport(), rPropSet));
- for (const XMLPropertyState& rState : aAddStates)
- aPropStates.push_back( rState );
+ aPropStates.insert( aPropStates.end(), aAddStates.begin(), aAddStates.end() );
if( std::any_of( aPropStates.begin(), aPropStates.end(), lcl_validPropState ) )
sName = GetAutoStylePool().Find( nFamily, sName, aPropStates );