diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-10-17 20:33:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-23 08:55:00 +0200 |
commit | c68be56c295c8dda3043c80d4641575ec2799e55 (patch) | |
tree | 40fc9a82e021498f7cebe76e59bec5bb85d6385c /idlc/source/idlccompile.cxx | |
parent | 437dc68285dab0f08a1ded2193d86d64f560cd9b (diff) |
size some stringbuffer to prevent re-alloc
Change-Id: I385587a922c555c320a45dcc6d644315b72510e9
Reviewed-on: https://gerrit.libreoffice.org/81278
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idlc/source/idlccompile.cxx')
-rw-r--r-- | idlc/source/idlccompile.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index 56dbfe4e77ec..8d3897890e0f 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -238,7 +238,6 @@ sal_Int32 compileFile(const OString * pathname) lCppArgs.emplace_back("-C"); lCppArgs.emplace_back("-zI"); - OStringBuffer cppArgs(256); Options* pOptions = idlc()->getOptions(); OString filePath; @@ -250,10 +249,9 @@ sal_Int32 compileFile(const OString * pathname) if ( !filePath.isEmpty() ) { - cppArgs.append("-I"); - cppArgs.append(filePath); + OString cppArgs = "-I" + filePath; lCppArgs.push_back(OStringToOUString( - cppArgs.makeStringAndClear().replace('\\', '/'), + cppArgs.replace('\\', '/'), RTL_TEXTENCODING_UTF8)); } } @@ -284,11 +282,9 @@ sal_Int32 compileFile(const OString * pathname) lCppArgs.emplace_back("-o"); - cppArgs.append(preprocFile); - lCppArgs.push_back(OStringToOUString(cppArgs.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); + lCppArgs.push_back(OStringToOUString(preprocFile, RTL_TEXTENCODING_UTF8)); - cppArgs.append(tmpFile); - lCppArgs.push_back(OStringToOUString(cppArgs.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); + lCppArgs.push_back(OStringToOUString(tmpFile, RTL_TEXTENCODING_UTF8)); OUString cpp; OUString startDir; |