diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-07-29 12:57:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-02 10:32:26 +0200 |
commit | 12af39cf39240f211b0601da3ed68d49db924181 (patch) | |
tree | 1d64ca7027006d5f1dc28edcf90e3a3c80e60965 /sal/rtl | |
parent | 0327615ca7df3de463c9773b1284e5089b7e481a (diff) |
Use memcpy for string ImplNewCopy functions
Change-Id: If0072a2fd7d3111b48413143610025124f365207
Reviewed-on: https://gerrit.libreoffice.org/58275
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/strtmpl.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx index e1ab1dce278c..c4f8fa605efa 100644 --- a/sal/rtl/strtmpl.cxx +++ b/sal/rtl/strtmpl.cxx @@ -1165,18 +1165,13 @@ static IMPL_RTL_STRCODE* IMPL_RTL_STRINGNAME( ImplNewCopy )( IMPL_RTL_STRINGDATA pDest = pData->buffer; pSrc = pStr->buffer; - while ( nCount > 0 ) - { - *pDest = *pSrc; - pDest++; - pSrc++; - nCount--; - } + + memcpy( pDest, pSrc, nCount * sizeof(IMPL_RTL_STRCODE)); *ppThis = pData; RTL_LOG_STRING_NEW( pData ); - return pDest; + return pDest + nCount; } /* ======================================================================= */ |