sal/rtl/math.cxx |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 8d131274e7aca598a89060cb0fbf7afb239b9034
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Sep 29 15:37:46 2021 +0200
Commit:     Mike Kaganski <mike.kagan...@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.kagan...@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)

Reply via email to