[Libreoffice-commits] core.git: ucb/source
Noel Grandin
noel.grandin at collabora.co.uk
Wed Jul 11 10:04:25 UTC 2018
ucb/source/ucp/file/filinpstr.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 2e6afbe65c75c919665927f62efa21140a020d46
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Wed Jul 11 08:13:48 2018 +0200
tdf#79877 perf loading docx file, activate SAX threading
our nice threaded parser was not kicking in because it checks the size
of the stream with available(), and this available() implementation was
just returning 0.
This makes for a 5-10% performance improvement
Change-Id: I6516862c9c63136b54ca825dd98e35e6d87d4227
Reviewed-on: https://gerrit.libreoffice.org/57263
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx
index 997605a79409..faa16cd2783a 100644
--- a/ucb/source/ucp/file/filinpstr.cxx
+++ b/ucb/source/ucp/file/filinpstr.cxx
@@ -155,7 +155,8 @@ XInputStream_impl::skipBytes( sal_Int32 nBytesToSkip )
sal_Int32 SAL_CALL
XInputStream_impl::available()
{
- return 0;
+ sal_Int64 avail = getLength() - getPosition();
+ return std::min<sal_Int64>(avail, SAL_MAX_INT32);
}
More information about the Libreoffice-commits
mailing list