diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-05 14:12:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-06 08:23:35 +0200 |
commit | ad1e790d76492ca4465114ad17e32912242db34f (patch) | |
tree | dccd3a678460fe05e7c2f7fd201c613f136439da /unoidl | |
parent | 1cf48243995410ca9455df573dff94d122874f0b (diff) |
small optimisations
In UNOMemoryStream
(a) let the vector use it's natural grow strategy, so we avoid extending
the vector by only the small amount we need now.
(b) don't throw the vector storage away on truncate, we might need it
soon
In unoidl/ reserve some vector capacities.
Change-Id: I6668a679e689d46d311a9e11eb3d0bc3395f3b6e
Reviewed-on: https://gerrit.libreoffice.org/75136
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/source/legacyprovider.cxx | 1 | ||||
-rw-r--r-- | unoidl/source/unoidlprovider.cxx | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx index 35ebf8d417ce..8e517e986f67 100644 --- a/unoidl/source/legacyprovider.cxx +++ b/unoidl/source/legacyprovider.cxx @@ -300,6 +300,7 @@ rtl::Reference< Entity > readEntity( translateAnnotations(reader.getFieldDocumentation(j))); } std::vector< InterfaceTypeEntity::Method > meths; + meths.reserve(methodCount); for (sal_uInt16 j = 0; j != methodCount; ++j) { RTMethodMode flags = reader.getMethodFlags(j); if (flags != RTMethodMode::ATTRIBUTE_GET diff --git a/unoidl/source/unoidlprovider.cxx b/unoidl/source/unoidlprovider.cxx index 6685f1fe289a..bde4d74a6a12 100644 --- a/unoidl/source/unoidlprovider.cxx +++ b/unoidl/source/unoidlprovider.cxx @@ -1010,6 +1010,7 @@ rtl::Reference< Entity > readEntity( } offset += 4; std::vector< InterfaceTypeEntity::Method > meths; + meths.reserve(nMeths); for (sal_uInt32 i = 0; i != nMeths; ++i) { OUString methName(file->readIdxName(&offset)); checkEntityName(file, methName); |