diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-31 23:21:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-01 09:53:37 +0100 |
commit | 0a90cb6510a0d6e1889569035ae78085637c9133 (patch) | |
tree | be53a95d135a433d29af63c219ca6ae97dae4a06 /sal | |
parent | ditch x_rtl_uString_release (diff) | |
download | core-0a90cb6510a0d6e1889569035ae78085637c9133.tar.gz core-0a90cb6510a0d6e1889569035ae78085637c9133.zip |
micro-opt, just use memset
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/source/strtmpl.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sal/rtl/source/strtmpl.c b/sal/rtl/source/strtmpl.c index bf3f4fd44600..830521d7b94f 100644 --- a/sal/rtl/source/strtmpl.c +++ b/sal/rtl/source/strtmpl.c @@ -31,6 +31,8 @@ /* String-Class */ /* ======================================================================= */ +#include <string.h> + /* inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest, const IMPL_RTL_STRCODE* pSrc, @@ -1049,12 +1051,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( new_WithLength )( IMPL_RTL_STRINGDATA** ppThi { IMPL_RTL_STRCODE* pTempStr = (*ppThis)->buffer; - while ( nLen >= 0 ) - { - *pTempStr = 0; - pTempStr++; - nLen--; - } + memset(pTempStr, 0, nLen*sizeof(IMPL_RTL_STRCODE)); } } } |