diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-08 09:30:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-08 10:44:34 +0200 |
commit | 9b7729c6e224dfbe89e309aab8e8fd392fc234ad (patch) | |
tree | bf4ef886093a9c3c2b90d2aaa4a5e354f2122aea /comphelper | |
parent | 1c6218df32838dc77da8e15dc5ce47eadad1a13f (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/streaming/memorystream.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
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]); |