From f5d02bdc6831588c0442fa24c5913971a224c4fa Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 10 Oct 2019 11:09:24 +0200 Subject: Forward constarray-handling append/insert code to basic methods so that we only have small number of places where to track capacity change (I need that to try to analyze where the reallocations happen most often) Change-Id: I077d5ebab845cb7e1deaac363d46e1fb2dbbb0c7 Reviewed-on: https://gerrit.libreoffice.org/80593 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/rtl/strbuf.hxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'include/rtl/strbuf.hxx') diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx index 832c48959d47..afead770298d 100644 --- a/include/rtl/strbuf.hxx +++ b/include/rtl/strbuf.hxx @@ -531,11 +531,9 @@ public: RTL_STRING_CONST_FUNCTION assert( libreoffice_internal::ConstCharArrayDetector::isValid(literal)); - rtl_stringbuffer_insert( - &pData, &nCapacity, getLength(), + return append( libreoffice_internal::ConstCharArrayDetector::toPointer(literal), libreoffice_internal::ConstCharArrayDetector::length); - return *this; } /** @@ -801,11 +799,10 @@ public: RTL_STRING_CONST_FUNCTION assert( libreoffice_internal::ConstCharArrayDetector::isValid(literal)); - rtl_stringbuffer_insert( - &pData, &nCapacity, offset, + return insert( + offset, libreoffice_internal::ConstCharArrayDetector::toPointer(literal), libreoffice_internal::ConstCharArrayDetector::length); - return *this; } /** -- cgit