summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 13:15:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-27 11:15:46 +0200
commitc8fa03b1f565461364b9f6423b65680e09281c14 (patch)
tree78ff35dfeb569354b41e89b9d55d77b46f7d3d95 /i18npool
parent82a4ef72d6e34c2f5075069a1b353f7fd41c7595 (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 'i18npool')
-rw-r--r--i18npool/source/indexentry/genindex_data.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/i18npool/source/indexentry/genindex_data.cxx b/i18npool/source/indexentry/genindex_data.cxx
index d505dc9b661f..871b742d9b86 100644
--- a/i18npool/source/indexentry/genindex_data.cxx
+++ b/i18npool/source/indexentry/genindex_data.cxx
@@ -25,6 +25,7 @@
#include <sal/main.h>
#include <sal/types.h>
#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
#define MAX_ADDRESS 0x30000
#define MAX_INDEX MAX_ADDRESS/0x100
@@ -48,7 +49,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
sal_Int32 address[MAX_ADDRESS];
for (i=0; i<MAX_ADDRESS; i++) address[i]=-1;
OUString sep=OUString('|');
- OUString result=sep;
+ OUStringBuffer result=sep;
sal_Int32 max=0;
sal_Char str[1024];
@@ -78,7 +79,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
address[nChar]=idx;
} else {
address[nChar]=result.getLength();
- result+=key;
+ result.append(key);
}
}
fclose(fp);