[Libreoffice-commits] core.git: sal/rtl

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 1 12:17:49 UTC 2021


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

New commits:
commit d7bd370e7ec71ae8e511c21aa1a2bb51b6c208a3
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Oct 1 08:28:25 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Oct 1 14:17:17 2021 +0200

    Use std::memmove instead of loop
    
    Change-Id: Ia88ceaaad700bf3c2c8db9bb19146b75146dad3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122861
    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 7aefe09a5fa6..970f2e298e02 100644
--- a/sal/rtl/math.cxx
+++ b/sal/rtl/math.cxx
@@ -627,13 +627,7 @@ void doubleToString(typename T::String ** pResult,
                                     {
                                         if (eFormat == rtl_math_StringFormat_F)
                                         {   // insert '1'
-                                            typename T::Char * px = p++;
-                                            while (pBuf < px)
-                                            {
-                                                *px = *(px-1);
-                                                px--;
-                                            }
-
+                                            std::memmove(pBuf + 1, pBuf, (p++ - pBuf) * sizeof(*p));
                                             pBuf[0] = '1';
                                         }
                                         else


More information about the Libreoffice-commits mailing list