summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-01 16:03:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-02 11:56:45 +0200
commitb392d0a25e229f305497ab5f9f084b71b24cc387 (patch)
tree41df3434451c4c139fadb6dd4491b02796d3dbdc /sc/source
parent3869673f95fce5e83c9d5d9eaf08f21f36ad0bd6 (diff)
tdf#150712 reduce cost of SharedString::getString
where the construction of empty strings is significant here which required fixing a couple of places that ended up using a reference to a temporary. Change-Id: I52feb1673bd39db4060585ac8d9ae2f3dea27fc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/interpr8.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index df75c92d41f1..8d3f7c25f489 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1395,9 +1395,9 @@ void ScInterpreter::ScConcat_MS()
case svString:
case svDouble:
{
- const OUString& rStr = GetString().getString();
- if (CheckStringResultLen(aResBuf, rStr.getLength()))
- aResBuf.append( rStr);
+ OUString aStr = GetString().getString();
+ if (CheckStringResultLen(aResBuf, aStr.getLength()))
+ aResBuf.append(aStr);
}
break;
case svSingleRef :
@@ -1476,17 +1476,17 @@ void ScInterpreter::ScConcat_MS()
{
if ( pMat->IsStringOrEmpty( j, k ) )
{
- const OUString& rStr = pMat->GetString( j, k ).getString();
- if (CheckStringResultLen(aResBuf, rStr.getLength()))
- aResBuf.append( rStr);
+ OUString aStr = pMat->GetString( j, k ).getString();
+ if (CheckStringResultLen(aResBuf, aStr.getLength()))
+ aResBuf.append(aStr);
}
else
{
if ( pMat->IsValue( j, k ) )
{
- const OUString& rStr = pMat->GetString( *pFormatter, j, k ).getString();
- if (CheckStringResultLen(aResBuf, rStr.getLength()))
- aResBuf.append( rStr);
+ OUString aStr = pMat->GetString( *pFormatter, j, k ).getString();
+ if (CheckStringResultLen(aResBuf, aStr.getLength()))
+ aResBuf.append(aStr);
}
}
}