From 7d8e94444d989d0ac4a4055b207726708e9ec0da Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 11 Jan 2018 08:47:15 +0200 Subject: convert ab?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/source/search/levdis.cxx | 10 +++++----- i18npool/source/search/textsearch.cxx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'i18npool/source/search') diff --git a/i18npool/source/search/levdis.cxx b/i18npool/source/search/levdis.cxx index 7795cf7bc168..9e4d9afe527c 100644 --- a/i18npool/source/search/levdis.cxx +++ b/i18npool/source/search/levdis.cxx @@ -316,9 +316,9 @@ int WLevDistance::LCM( int a, int b ) inline int WLevDistance::Min3( int x, int y, int z ) { if ( x < y ) - return( x < z ? x : z ); + return std::min(x, z); else - return( y < z ? y : z ); + return std::min(y, z); } // The value in the middle @@ -326,11 +326,11 @@ int WLevDistance::Mid3( int x, int y, int z ) { int min = Min3(x,y,z); if ( x == min ) - return( y < z ? y : z); + return std::min(y, z); else if ( y == min ) - return( x < z ? x : z); + return std::min(x, z); else // z == min - return( x < y ? x : y); + return std::min(x, y); } // Maximum of three values diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 6f51d3b2cbf0..a2c20342bee3 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -1062,7 +1062,7 @@ SearchResult TextSearch::ApproxSrchFrwrd( const OUString& searchStr, if( aWBnd.startPos >= endPos ) break; nStt = aWBnd.startPos < startPos ? startPos : aWBnd.startPos; - nEnd = aWBnd.endPos > endPos ? endPos : aWBnd.endPos; + nEnd = std::min(aWBnd.endPos, endPos); if( nStt < nEnd && pWLD->WLD( searchStr.getStr() + nStt, nEnd - nStt ) <= nLimit ) @@ -1106,7 +1106,7 @@ SearchResult TextSearch::ApproxSrchBkwrd( const OUString& searchStr, if( aWBnd.endPos <= endPos ) break; nStt = aWBnd.startPos < endPos ? endPos : aWBnd.startPos; - nEnd = aWBnd.endPos > startPos ? startPos : aWBnd.endPos; + nEnd = std::min(aWBnd.endPos, startPos); if( nStt < nEnd && pWLD->WLD( searchStr.getStr() + nStt, nEnd - nStt ) <= nLimit ) -- cgit