diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-12 15:38:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-16 07:53:49 +0100 |
commit | bf4bbc3c2174b21577b8878bc3197923ba44a029 (patch) | |
tree | 22ec4b4da1bc2b86b6b27776fd64fd2b89a9ed3e /sal/rtl | |
parent | b977a8786ff39f1348bafdbf2dd83e7008ed3086 (diff) |
replace std::max(std::min()) with std::clamp
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/math.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx index fe81f4c5a7f7..af3e52f2bf9d 100644 --- a/sal/rtl/math.cxx +++ b/sal/rtl/math.cxx @@ -288,7 +288,7 @@ void doubleToString(typename T::String ** pResult, if (nDecPlaces == rtl_math_DecimalPlaces_Max) nDecPlaces = 0; else - nDecPlaces = ::std::max< sal_Int32 >(::std::min<sal_Int32>(nDecPlaces, 15), -15); + nDecPlaces = ::std::clamp< sal_Int32 >(nDecPlaces, -15, 15); if (bEraseTrailingDecZeros && nDecPlaces > 0) nDecPlaces = 0; @@ -437,7 +437,7 @@ void doubleToString(typename T::String ** pResult, // rtl_math_DecimalPlaces_Max was passed with rtl_math_StringFormat_F or // others, but we don't want to allocate/deallocate 2GB just to fill it // with trailing '0' characters.. - nDecPlaces = std::max<sal_Int32>(std::min<sal_Int32>(nDecPlaces, 20), -20); + nDecPlaces = std::clamp<sal_Int32>(nDecPlaces, -20, 20); sal_Int32 nDigits = nDecPlaces + 1; |