diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-13 08:47:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 08:26:14 +0200 |
commit | 9b5dad13b56bdde7c40970351af3da3a2c3c9350 (patch) | |
tree | abfd4b02743a0e6a93c51c026f4c53f0e21100bc /codemaker/source/cppumaker | |
parent | fa71320329999c968feb16ff65be328b5b8ff5e4 (diff) |
loplugin:stringadd look for unnecessary temporaries
which defeat the *StringConcat optimisation.
Also make StringConcat conversions treat a nullptr as an empty string,
to match the O*String(char*) constructors.
Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b
Reviewed-on: https://gerrit.libreoffice.org/80724
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'codemaker/source/cppumaker')
-rw-r--r-- | codemaker/source/cppumaker/cppuoptions.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx index 0e25ae2f5da7..05c941b2c68a 100644 --- a/codemaker/source/cppumaker/cppuoptions.cxx +++ b/codemaker/source/cppumaker/cppuoptions.cxx @@ -76,7 +76,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-O', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i+1]) + "'"; + tmp += OStringLiteral(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -92,7 +92,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) case 'n': if (av[i][2] != 'D' || av[i][3] != '\0') { - OString tmp = "'-nD', please check your input '" + OString(av[i]) + "'"; + OString tmp = OStringLiteral("'-nD', please check your input '") + av[i] + "'"; throw IllegalArgument(tmp); } @@ -111,7 +111,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-T', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i+1]) + "'"; + tmp += OStringLiteral(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -138,7 +138,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-L', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i]) + "'"; + tmp += OStringLiteral(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -158,7 +158,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-CS', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i]) + "'"; + tmp += OStringLiteral(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -176,7 +176,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-C', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i]) + "'"; + tmp += OStringLiteral(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -196,7 +196,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-Gc', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i]) + "'"; + tmp += OStringLiteral(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -210,7 +210,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-G', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i]) + "'"; + tmp += OStringLiteral(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -232,7 +232,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-X', please check"); if (i <= ac - 1) { - tmp += " your input '" + OString(av[i+1]) + "'"; + tmp += OStringLiteral(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -248,7 +248,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) } default: - throw IllegalArgument("the option is unknown" + OString(av[i])); + throw IllegalArgument(OStringLiteral("the option is unknown") + av[i]); } } else { |