diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-10-22 10:30:25 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-10-22 16:32:43 +0200 |
commit | 29e200aa0af78a4589bf7e52dddfb62f3bdf4e01 (patch) | |
tree | 963c3e437f0e4cec5a0be50d79c5c660062e47eb /sal | |
parent | d6a26e26505ec1f6810c6b749129a79ba0931742 (diff) |
revert part of "Simplify vector initialization in sal"
This first allocates space based on the two items, and only
afterwards it reserves space for all items, possibly allocating
again.
This partially reverts commit 8546cdb2ad25b03ac152615357cab00 .
Change-Id: I8668cb03881766fc5078ab5e411efe56e6f3009e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124054
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/backtraceapi.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx index 3022be8dd829..23d3bec498b9 100644 --- a/sal/osl/unx/backtraceapi.cxx +++ b/sal/osl/unx/backtraceapi.cxx @@ -79,12 +79,10 @@ void process_file_addr2line( const char* file, std::vector<FrameData>& frameData OUString arg1("-Cfe"); OUString arg2 = OUString::fromUtf8(file); std::vector<OUString> addrs; - std::vector<rtl_uString*> args - { - arg1.pData, - arg2.pData - }; + std::vector<rtl_uString*> args; args.reserve(frameData.size() + 2); + args.push_back( arg1.pData ); + args.push_back( arg2.pData ); for( FrameData& frame : frameData ) { if( frame.file != nullptr && strcmp( file, frame.file ) == 0 ) |