diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-10 11:51:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-10 17:59:45 +0100 |
commit | 17950f4d204e9947f125ebc0aac1156eba6501f2 (patch) | |
tree | 1b51bdc13a1006aeb29a6dff658ba1b3f1028708 /connectivity | |
parent | 952b3b227e02ae4eedce3138fcb39613bf12486d (diff) |
use less SvStream::Flush()
Flush() turns into a sync() on the device, which is pretty slow.
Most of the time all we actually want to do is to flush the internal
buffers from the SvStream.
So expose the FlushBuffer method and use that where possible.
And also means we don't need the mbDontFlushOnClose flag on SvStream
any more.
Change-Id: Ibe089b88b325f0fdc565200a97ce72cd26b7fcfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128214
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FTable.cxx | 3 |
2 files changed, 0 insertions, 7 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index c5da1d6b2477..0f8f72328a0b 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1004,9 +1004,6 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool void ODbaseTable::FileClose() { ::osl::MutexGuard aGuard(m_aMutex); - // if not everything has been written yet - if (m_pMemoStream && m_pMemoStream->IsWritable()) - m_pMemoStream->Flush(); m_pMemoStream.reset(); @@ -1415,7 +1412,6 @@ bool ODbaseTable::CreateMemoFile(const INetURLObject& aFile) m_pMemoStream->Seek(0); (*m_pMemoStream).WriteUInt32( 1 ); // pointer to the first free block - m_pMemoStream->Flush(); m_pMemoStream.reset(); return true; } diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx index 50475449ef73..af2d6de226f8 100644 --- a/connectivity/source/drivers/file/FTable.cxx +++ b/connectivity/source/drivers/file/FTable.cxx @@ -136,9 +136,6 @@ void OFileTable::FileClose() { ::osl::MutexGuard aGuard(m_aMutex); - if (m_pFileStream && m_pFileStream->IsWritable()) - m_pFileStream->Flush(); - m_pFileStream.reset(); m_pBuffer.reset(); } |