From d8d15656817a58a5e9c6a6ebc88038ba4e5ef865 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 16 May 2021 13:17:22 +0200 Subject: small perf improvement in readMemberValues Change-Id: I5d5973401a87b69dd54721d16ed19e227a6c2ac6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115674 Tested-by: Jenkins Reviewed-by: Noel Grandin --- binaryurp/source/unmarshal.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'binaryurp') diff --git a/binaryurp/source/unmarshal.cxx b/binaryurp/source/unmarshal.cxx index d307c81cc0b5..4263edf8c91c 100644 --- a/binaryurp/source/unmarshal.cxx +++ b/binaryurp/source/unmarshal.cxx @@ -437,6 +437,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) { return BinaryAny(type, &p); } std::vector< BinaryAny > as; + as.reserve(n); for (sal_uInt32 i = 0; i != n; ++i) { as.push_back(readValue(ctd)); } @@ -477,6 +478,7 @@ void Unmarshal::readMemberValues( css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase), values); } + values->reserve(values->size() + ctd->nMembers); for (sal_Int32 i = 0; i != ctd->nMembers; ++i) { values->push_back( readValue(css::uno::TypeDescription(ctd->ppTypeRefs[i]))); -- cgit