From d7bd370e7ec71ae8e511c21aa1a2bb51b6c208a3 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 1 Oct 2021 08:28:25 +0200 Subject: 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 --- sal/rtl/math.cxx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sal') 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 -- cgit v1.2.3