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 --- cppu/source/uno/EnvStack.cxx | 2 +- cppu/source/uno/lbenv.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cppu') diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx index 5757023cbb88..748557e8b98a 100644 --- a/cppu/source/uno/EnvStack.cxx +++ b/cppu/source/uno/EnvStack.cxx @@ -119,7 +119,7 @@ extern "C" void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl if (pTypeName && rtl_uString_getLength(pTypeName)) { - OUString envDcp = OUString(pTypeName) + currPurpose; + OUString envDcp = OUString::unacquired(&pTypeName) + currPurpose; uno_getEnvironment(ppEnv, envDcp.pData, nullptr); } diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index 71a8e8cb484d..fd1464d5244f 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -933,7 +933,7 @@ void EnvironmentsData::registerEnvironment( uno_Environment ** ppEnv ) OUString aKey = OUString::number( reinterpret_cast< sal_IntPtr >(pEnv->pContext) ) + - OUString(pEnv->pTypeName); + OUString::unacquired(&pEnv->pTypeName); // try to find registered environment OUString2EnvironmentMap::const_iterator const iFind( -- cgit