From 9b5dad13b56bdde7c40970351af3da3a2c3c9350 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 13 Oct 2019 08:47:47 +0200 Subject: loplugin:stringadd look for unnecessary temporaries which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/source/breakiterator/breakiterator_unicode.cxx | 2 +- i18npool/source/localedata/localedata.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'i18npool') diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index fea868eb85e9..6312d1feecd5 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -213,7 +213,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal rbi.reset(); // ;rule (only) - const OString aBIMapRuleOnlyKey( OString(";") + rule); + const OString aBIMapRuleOnlyKey( OStringLiteral(";") + rule); aMapIt = theBIMap.find( aBIMapRuleOnlyKey); bInMap = (aMapIt != theBIMap.end()); if (bInMap) diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index d09f65772c60..68a0d9359b47 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -1093,7 +1093,7 @@ OUString LocaleDataImpl::getIndexKeysByAlgorithm( const Locale& rLocale, const OUString& algorithm ) { sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm); - return indexArray ? "0-9"+OUString(indexArray[2]) : OUString(); + return indexArray ? (OUStringLiteral("0-9") + indexArray[2]) : OUString(); } OUString -- cgit