diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-26 13:15:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-27 11:15:46 +0200 |
commit | c8fa03b1f565461364b9f6423b65680e09281c14 (patch) | |
tree | 78ff35dfeb569354b41e89b9d55d77b46f7d3d95 /unoidl | |
parent | 82a4ef72d6e34c2f5075069a1b353f7fd41c7595 (diff) |
new loplugin:stringloop, and applied in various
look for OUString being appended to in a loop, better to use
OUStringBuffer to accumulate the results.
Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b
Reviewed-on: https://gerrit.libreoffice.org/58092
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/source/sourceprovider-parser.y | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y index 529d2045a273..bb4f5dc2a92a 100644 --- a/unoidl/source/sourceprovider-parser.y +++ b/unoidl/source/sourceprovider-parser.y @@ -16,6 +16,8 @@ #include <sal/config.h> +#include <rtl/ustrbuf.hxx> + #include <algorithm> #include <cassert> #include <cerrno> @@ -4013,14 +4015,14 @@ OUString SourceProviderType::getName() const { return name; case unoidl::detail::SourceProviderType::TYPE_INSTANTIATED_POLYMORPHIC_STRUCT: { - OUString n(name + "<"); + OUStringBuffer n(name + "<"); for (auto i(subtypes.begin()); i != subtypes.end(); ++i) { if (i != subtypes.begin()) { - n += ","; + n.append(","); } - n += i->getName(); + n.append(i->getName()); } - return n + ">"; + return n.append(">").makeStringAndClear(); } default: assert(false && "this cannot happen"); for (;;) { std::abort(); } |