[Libreoffice-commits] core.git: include/tools tools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jun 19 19:24:39 UTC 2021
include/tools/stream.hxx | 2 +-
tools/source/stream/stream.cxx | 9 ---------
2 files changed, 1 insertion(+), 10 deletions(-)
New commits:
commit 5c59e061c6271cfe2f8ec12ba21de50e71bd9ef4
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jun 19 15:45:27 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jun 19 21:24:00 2021 +0200
SvMemoryStream::GetSize can be more efficient
Change-Id: I6d60d6549089e049d730c1000ab7ec592924c685
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117499
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index b55a45ff3022..f99b09955368 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -658,7 +658,7 @@ public:
virtual void ResetError() override;
- sal_uInt64 GetSize();
+ sal_uInt64 GetSize() { return TellEnd(); }
std::size_t GetEndOfData() const { return nEndOfData; }
const void* GetData() { Flush(); return pBuf; }
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 04ddd2cba111..515f3a1657ab 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1673,15 +1673,6 @@ SvMemoryStream::~SvMemoryStream()
}
}
-sal_uInt64 SvMemoryStream::GetSize()
-{
- Flush();
- sal_uInt64 const nTemp = Tell();
- sal_uInt64 const nLength = Seek( STREAM_SEEK_TO_END );
- Seek( nTemp );
- return nLength;
-}
-
void SvMemoryStream::SetBuffer( void* pNewBuf, std::size_t nCount,
std::size_t nEOF )
{
More information about the Libreoffice-commits
mailing list