diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-10 00:53:58 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-10 06:23:13 +0200 |
commit | 627e8ac6313330eae892195a62d07db5b7d85a1b (patch) | |
tree | c77a6525b860ddcbd7f2273450e49233701004df /connectivity/source/drivers/firebird/Blob.cxx | |
parent | 541ddf4580cac8c3f9590be26a487f5fc8e2553c (diff) |
Use std::vector instead of css::uno::Sequence
This allows to avoid multiple reallocations during successive reads
Change-Id: I74102d21c5dc4d1e92e27ede3490e9ed07bd568e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121873
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'connectivity/source/drivers/firebird/Blob.cxx')
-rw-r--r-- | connectivity/source/drivers/firebird/Blob.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx index edcc0d233989..33ab36b8d33e 100644 --- a/connectivity/source/drivers/firebird/Blob.cxx +++ b/connectivity/source/drivers/firebird/Blob.cxx @@ -122,22 +122,22 @@ sal_uInt16 Blob::getMaximumSegmentSize() return m_nMaxSegmentSize; } -bool Blob::readOneSegment(uno::Sequence< sal_Int8 >& rDataOut) +bool Blob::readOneSegment(std::vector<char>& rDataOut) { checkDisposed(Blob_BASE::rBHelper.bDisposed); ensureBlobIsOpened(); sal_uInt16 nMaxSize = getMaximumSegmentSize(); - if(rDataOut.getLength() < nMaxSize) - rDataOut.realloc(nMaxSize); + if(rDataOut.size() < nMaxSize) + rDataOut.resize(nMaxSize); sal_uInt16 nActualSize = 0; ISC_STATUS aRet = isc_get_segment(m_statusVector, &m_blobHandle, &nActualSize, nMaxSize, - reinterpret_cast<char*>(rDataOut.getArray()) ); + rDataOut.data() ); if (aRet && aRet != isc_segstr_eof && IndicatesError(m_statusVector)) { @@ -145,8 +145,8 @@ bool Blob::readOneSegment(uno::Sequence< sal_Int8 >& rDataOut) throw IOException(sError, *this); } - if (rDataOut.getLength() > nActualSize) - rDataOut.realloc(nActualSize); + if (rDataOut.size() > nActualSize) + rDataOut.resize(nActualSize); m_nBlobPosition += nActualSize; return aRet == isc_segstr_eof; // last segment read } |