From 85c2ed8dc790689ce69ff0a08ff5a4de98df54b7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 10 Apr 2022 20:17:54 +0200 Subject: loplugin:stringview add check for getToken().toInt32 where we can convert that to o3tl::toInt32(o3tl::getToken( and avoid the heap allocation of a temporary string Change-Id: Ib11c19c6e6cdc0de3e551affd3578d181e292de4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132810 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/source/localedata/localedata.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'i18npool') diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 0a2b9a4bf751..ff1246b452b3 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -33,6 +33,7 @@ #include #include #include +#include namespace com::sun::star::uno { class XComponentContext; } @@ -1079,7 +1080,7 @@ LocaleDataImpl::getUnicodeScripts( const Locale& rLocale ) Sequence< UnicodeScript > seq(scriptCount); auto seqRange = asNonConstRange(seq); for(sal_Int16 i = 0; i < scriptCount; i++) { - seqRange[i] = UnicodeScript( OUString(scriptArray[i]).toInt32() ); + seqRange[i] = UnicodeScript( o3tl::toInt32(std::u16string_view(scriptArray[i], 1)) ); } return seq; } -- cgit