From 9b7729c6e224dfbe89e309aab8e8fd392fc234ad Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2019 09:30:13 +0200 Subject: revert part of "small optimisations" from commit ad1e790d76492ca4465114ad17e32912242db34f Date: Fri Jul 5 14:12:24 2019 +0200 small optimisations I had in mind that resize() always changes capacity to the specified value, but it actually follows the normal capacity expansion strategy for vector Change-Id: Idf677825d0f1f95b87110a3789ba95356d3771aa Reviewed-on: https://gerrit.libreoffice.org/75193 Tested-by: Jenkins Reviewed-by: Noel Grandin --- comphelper/source/streaming/memorystream.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'comphelper') diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx index 4477cd068188..741c4346d310 100644 --- a/comphelper/source/streaming/memorystream.cxx +++ b/comphelper/source/streaming/memorystream.cxx @@ -197,7 +197,7 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< sal_Int8 >& aData ) } if( static_cast< sal_Int32 >( nNewSize ) > static_cast< sal_Int32 >( maData.size() ) ) - maData.insert( maData.end(), nNewSize - maData.size(), 0 ); + maData.resize( nNewSize ); sal_Int8* pData = &(*maData.begin()); sal_Int8* pCursor = &(pData[mnCursor]); -- cgit