diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-04-02 14:26:43 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-04-02 14:50:41 +0100 |
commit | 54bc03051702ad279dfd17471a3d5c30003c892d (patch) | |
tree | 12295d98f7941a6e69109db045aeb87d46b5285d /sal | |
parent | Fetch the right libcdr (diff) | |
download | core-54bc03051702ad279dfd17471a3d5c30003c892d.tar.gz core-54bc03051702ad279dfd17471a3d5c30003c892d.zip |
sal: reduce allocation thrash in URI encode / decode
This saves 1% of string allocation / destruction on startup.
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/source/uri.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sal/rtl/source/uri.cxx b/sal/rtl/source/uri.cxx index 5febefd03bf9..3945e049c7ab 100644 --- a/sal/rtl/source/uri.cxx +++ b/sal/rtl/source/uri.cxx @@ -609,8 +609,8 @@ void SAL_CALL rtl_uriEncode(rtl_uString * pText, sal_Bool const * pCharClass, sal_Unicode const * p = pText->buffer; sal_Unicode const * pEnd = p + pText->length; - sal_Int32 nCapacity = 0; - rtl_uString_new(pResult); + sal_Int32 nCapacity = pText->length; + rtl_uString_new_WithLength(pResult, nCapacity); while (p < pEnd) { EscapeType eType; @@ -676,8 +676,8 @@ void SAL_CALL rtl_uriDecode(rtl_uString * pText, { sal_Unicode const * p = pText->buffer; sal_Unicode const * pEnd = p + pText->length; - sal_Int32 nCapacity = 0; - rtl_uString_new(pResult); + sal_Int32 nCapacity = pText->length; + rtl_uString_new_WithLength(pResult, nCapacity); while (p < pEnd) { EscapeType eType; |