From 11c8109fa109ef8178679b4de6efde695b99e0a8 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 17 Sep 2021 07:42:31 +0200 Subject: Drop this unneeded indirection Change-Id: I6b40642c7574a1863658854d206ed849517dbd0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122130 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sal/rtl/string.cxx | 4 ++-- sal/rtl/strtmpl.hxx | 8 -------- sal/rtl/ustring.cxx | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) (limited to 'sal') diff --git a/sal/rtl/string.cxx b/sal/rtl/string.cxx index 94be8029032a..b8a96d43a07b 100644 --- a/sal/rtl/string.cxx +++ b/sal/rtl/string.cxx @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -599,7 +598,8 @@ void SAL_CALL rtl_string_new(rtl_String** ppThis) SAL_THROW_EXTERN_C() rtl_String* SAL_CALL rtl_string_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C() { - return rtl::str::alloc(nLen); + assert(nLen >= 0); + return rtl::str::Alloc(nLen); } void SAL_CALL rtl_string_new_WithLength(rtl_String** ppThis, sal_Int32 nLen) SAL_THROW_EXTERN_C() diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx index 493184f92efa..f26c21225177 100644 --- a/sal/rtl/strtmpl.hxx +++ b/sal/rtl/strtmpl.hxx @@ -1099,14 +1099,6 @@ template void new_( IMPL_RTL_STRINGDATA** ppThis /* ----------------------------------------------------------------------- */ -template IMPL_RTL_STRINGDATA* alloc( sal_Int32 nLen ) -{ - assert(nLen >= 0); - return Alloc( nLen ); -} - -/* ----------------------------------------------------------------------- */ - template void new_WithLength( IMPL_RTL_STRINGDATA** ppThis, sal_Int32 nLen ) { diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx index 4aac64556666..ee84510bcc7f 100644 --- a/sal/rtl/ustring.cxx +++ b/sal/rtl/ustring.cxx @@ -27,7 +27,6 @@ #include #include -#include #include #include @@ -1793,7 +1792,8 @@ void SAL_CALL rtl_uString_new(rtl_uString** ppThis) SAL_THROW_EXTERN_C() rtl_uString* SAL_CALL rtl_uString_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C() { - return rtl::str::alloc(nLen); + assert(nLen >= 0); + return rtl::str::Alloc(nLen); } void SAL_CALL rtl_uString_new_WithLength(rtl_uString** ppThis, sal_Int32 nLen) SAL_THROW_EXTERN_C() -- cgit