summaryrefslogtreecommitdiff
path: root/vcl/skia
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-03 14:09:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-03 15:32:53 +0200
commitc5a0b7af847a71fd50f713934b29305f8ce96c6b (patch)
treed7c0193bc183250c36e467f830a4327ab94dc24e /vcl/skia
parentd19dbcc139d18771e5e20e82a694f1512476e41c (diff)
loplugin:stringadd improvement for appending numbers
I was wrong, the Concat framework already optimised appending numbers by stack-allocating small buffers, so include them in the plugin Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/skia')
-rw-r--r--vcl/skia/gdiimpl.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index b0a992fa942f..2e15d8dbb45f 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1619,15 +1619,10 @@ sk_sp<SkImage> SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma
// Do not cache the result if it would take most of the cache and thus get evicted soon.
if (targetSize.Width() * targetSize.Height() * 4 > maxImageCacheSize() * 0.7)
return image;
- OString key;
- OStringBuffer keyBuf;
- keyBuf.append(targetSize.Width())
- .append("x")
- .append(targetSize.Height())
- .append("_" + bitmap.GetImageKey());
+ OString key = OString::number(targetSize.Width()) + "x" + OString::number(targetSize.Height())
+ + "_" + bitmap.GetImageKey();
if (alphaBitmap)
- keyBuf.append("_" + alphaBitmap->GetAlphaImageKey());
- key = keyBuf.makeStringAndClear();
+ key += "_" + alphaBitmap->GetAlphaImageKey();
image = findCachedImage(key);
if (image)
{