From f14b9d30293f180500fc56d81e5390021758e7c1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jan 2018 17:01:49 +0200 Subject: convert (a>b?a:b) to std::max(a,b) with something like: git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2' Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413 Reviewed-on: https://gerrit.libreoffice.org/47602 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xmlhelp/source/cxxhelp/provider/urlparameter.cxx') diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 2d8a984ef957..b43d0d547b95 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -904,7 +904,7 @@ sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aDat for( int k = 0; k < curr; ++k ) aData[k] = buffer[pos++]; - return curr > 0 ? curr : 0; + return std::max(curr, 0); } @@ -924,7 +924,7 @@ void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip ) sal_Int32 SAL_CALL InputStreamTransformer::available() { osl::MutexGuard aGuard( m_aMutex ); - return buffer.getLength() - pos > 0 ? buffer.getLength() - pos : 0 ; + return std::max(buffer.getLength() - pos, 0); } -- cgit