[Libreoffice-commits] core.git: sal/rtl
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 29 14:30:19 UTC 2021
sal/rtl/math.cxx | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
New commits:
commit 8d131274e7aca598a89060cb0fbf7afb239b9034
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Sep 29 15:37:46 2021 +0200
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Sep 29 16:29:45 2021 +0200
Use std::reverse instead of swapping in a loop
Change-Id: Iee8966eeeaea461e34b5d22b80cb612dfaa57fe4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122750
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx
index 6de4d30383cd..b36aef117136 100644
--- a/sal/rtl/math.cxx
+++ b/sal/rtl/math.cxx
@@ -388,11 +388,7 @@ void doubleToString(typename T::String ** pResult,
*p++ = '-';
// Reverse buffer content.
- sal_Int32 n = (p - pBuf) / 2;
- for (sal_Int32 i=0; i < n; ++i)
- {
- ::std::swap( pBuf[i], p[-i-1]);
- }
+ std::reverse(pBuf, p);
// Append decimals.
if (nDecPlaces > 0)
More information about the Libreoffice-commits
mailing list