diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-07 10:34:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-14 08:35:00 +0200 |
commit | cd66852f6dd08631a25d15a1527a647e69ab8ce3 (patch) | |
tree | 0ac1fab1d063046376e31e21d6656ee05eebb627 /opencl | |
parent | 095e1ca4372d90da7fc56051f1271ddd975a9e3a (diff) |
create appendCopy method in OUStringBuffer
so we can avoid temporary copies when appending a substring of an
OUString to the buffer. I would have preferred to call the method just
"append" but that results in ambiguous method errors when the callsite
is something like
sal_Int32 n;
OUStringBuffer s;
s.append(n, 10);
I'm not sure why
Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f
Reviewed-on: https://gerrit.libreoffice.org/58666
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'opencl')
-rw-r--r-- | opencl/source/openclconfig.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx index 18a9f865be00..7517cf3fecdf 100644 --- a/opencl/source/openclconfig.cxx +++ b/opencl/source/openclconfig.cxx @@ -76,7 +76,7 @@ OUString getToken(const OUString& string, sal_Int32& index) while ((p = token.indexOf('%', i)) >= 0) { if (p > i) - result.append(token.copy(i, p - i)); + result.appendCopy(token, i, p - i); if (p < token.getLength() - 2) { result.append(OUStringLiteral1(token.copy(p+1, 2).toInt32(16))); @@ -87,7 +87,7 @@ OUString getToken(const OUString& string, sal_Int32& index) i = token.getLength(); } } - result.append(token.copy(i)); + result.appendCopy(token,i); return result.makeStringAndClear(); } |