diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-02-21 18:25:02 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-03-05 22:36:20 +0100 |
commit | 070ea7faa821a01b6a077e24724e37962173cb23 (patch) | |
tree | dbba3e1af669e0ad8b33fbe9fd091deef3ad400c /l10ntools | |
parent | 1e1559256bf64a8f782b6dcb70f191eec767d475 (diff) |
Use optimized OString concatenation
Change-Id: Iaefacf4a57398d0e88b4de7552af11832db3e881
Reviewed-on: https://gerrit.libreoffice.org/68178
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 39f98747e99c..f6939458c588 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -209,9 +209,7 @@ void LngParser::Merge( { sLang = sLang.trim(); - OString sSearch( ";" ); - sSearch += sLang; - sSearch += ";"; + OString sSearch{ ";" + sLang + ";" }; if ( sLanguagesDone.indexOf( sSearch ) != -1 ) { mvLines.erase( mvLines.begin() + nPos ); @@ -226,14 +224,11 @@ void LngParser::Merge( continue; if ( !sNewText.isEmpty()) { - OString & rLine = mvLines[ nPos ]; - - OString sText1( sLang ); - sText1 += " = \""; - // escape quotes, unescape double escaped quotes fdo#56648 - sText1 += sNewText.replaceAll("\"","\\\"").replaceAll("\\\\\"","\\\""); - sText1 += "\""; - rLine = sText1; + mvLines[ nPos ] = sLang + + " = \"" + // escape quotes, unescape double escaped quotes fdo#56648 + + sNewText.replaceAll("\"","\\\"").replaceAll("\\\\\"","\\\"") + + "\""; Text[ sLang ] = sNewText; } } @@ -264,12 +259,11 @@ void LngParser::Merge( continue; if ( !sNewText.isEmpty() && sCur != "x-comment") { - OString sLine; - sLine += sCur; - sLine += " = \""; - // escape quotes, unescape double escaped quotes fdo#56648 - sLine += sNewText.replaceAll("\"","\\\"").replaceAll("\\\\\"","\\\""); - sLine += "\""; + const OString sLine { sCur + + " = \"" + // escape quotes, unescape double escaped quotes fdo#56648 + + sNewText.replaceAll("\"","\\\"").replaceAll("\\\\\"","\\\"") + + "\"" }; nLastLangPos++; nPos++; |