diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 14:29:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 21:43:49 +0200 |
commit | 05f47e6d9f0c442e481b2435cc5c2ef615ab347a (patch) | |
tree | bfa2c4c29007a63d42a227456f2fc6717e79ccb3 /oox | |
parent | f9b104abc1185d4f9f3af66f49ec9e39f85a1c36 (diff) |
replace 'resize(size+1)' with emplace_back
which is considerably faster if we're dealing with a std::list, and just
easier on the eyes if we're dealing with a std::vector
Change-Id: I373689205ebc048689f29ab80a7ee8551b20cc96
Reviewed-on: https://gerrit.libreoffice.org/39816
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/contexthandler2.cxx | 2 | ||||
-rw-r--r-- | oox/source/docprop/ooxmldocpropimport.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/table/tablecontext.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/table/tablerowcontext.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/table/tablestylelistfragmenthandler.cxx | 2 | ||||
-rw-r--r-- | oox/source/ole/vbainputstream.cxx | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index 3d6aadf81484..50a2587e3e1f 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -144,7 +144,7 @@ void ContextHandler2Helper::implEndRecord( sal_Int32 nRecId ) ElementInfo& ContextHandler2Helper::pushElementInfo( sal_Int32 nElement ) { - mxContextStack->resize( mxContextStack->size() + 1 ); + mxContextStack->emplace_back(); ElementInfo& rInfo = mxContextStack->back(); rInfo.mnElement = nElement; return rInfo; diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index 638c7a0aa978..8bd24bdc9e08 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -91,7 +91,7 @@ Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxSto Reference< XInputStream > xInStream = xExtStream->getInputStream(); if( xInStream.is() ) { - aResult.resize( aResult.size() + 1 ); + aResult.emplace_back(); aResult.back().sSystemId = rEntry.Second; aResult.back().aInputStream = xExtStream->getInputStream(); } diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx index 2cfe580f8abe..39b7d1fca161 100644 --- a/oox/source/drawingml/table/tablecontext.cxx +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -77,7 +77,7 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& r case A_TOKEN( tr ): // CT_TableRow { std::vector< TableRow >& rvTableRows( mrTableProperties.getTableRows() ); - rvTableRows.resize( rvTableRows.size() + 1 ); + rvTableRows.emplace_back(); return new TableRowContext( *this, rAttribs, rvTableRows.back() ); } } diff --git a/oox/source/drawingml/table/tablerowcontext.cxx b/oox/source/drawingml/table/tablerowcontext.cxx index d8f5bb4b65fe..afef21608ec1 100644 --- a/oox/source/drawingml/table/tablerowcontext.cxx +++ b/oox/source/drawingml/table/tablerowcontext.cxx @@ -49,7 +49,7 @@ TableRowContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList case A_TOKEN( tc ): // CT_TableCell { std::vector< TableCell >& rvTableCells = mrTableRow.getTableCells(); - rvTableCells.resize( rvTableCells.size() + 1 ); + rvTableCells.emplace_back(); return new TableCellContext( *this, rAttribs, rvTableCells.back() ); } case A_TOKEN( extLst ): // CT_OfficeArtExtensionList diff --git a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx index b7c7afe10e84..2d5b60ff5a3a 100644 --- a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx +++ b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx @@ -54,7 +54,7 @@ ContextHandlerRef TableStyleListFragmentHandler::onCreateContext( break; case A_TOKEN( tblStyle ): // CT_TableStyle std::vector< TableStyle >& rTableStyles = mrTableStyleList.getTableStyles(); - rTableStyles.resize( rTableStyles.size() + 1 ); + rTableStyles.emplace_back(); return new TableStyleContext( *this, rAttribs, rTableStyles.back() ); } return this; diff --git a/oox/source/ole/vbainputstream.cxx b/oox/source/ole/vbainputstream.cxx index 0e9262ceab04..76b5cd6b49f5 100644 --- a/oox/source/ole/vbainputstream.cxx +++ b/oox/source/ole/vbainputstream.cxx @@ -184,7 +184,7 @@ bool VbaInputStream::updateChunk() // we suspect this will never be called else { - maChunk.resize( maChunk.size() + 1 ); + maChunk.emplace_back(); maChunk.back() = mpInStrm->readuChar(); ++nChunkPos; } |