summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/javavm/javavm.cxx3
-rw-r--r--stoc/source/simpleregistry/simpleregistry.cxx8
2 files changed, 8 insertions, 3 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 68db4a793265..86d546462f7a 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -711,7 +711,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId)
m_xContext);
const std::vector<OUString> & props = aJvm.getProperties();
std::vector<OUString> options;
- for (auto const & i: props)
+ options.reserve(props.size());
+ for (auto const& i : props)
{
options.push_back(i.startsWith("-") ? i : "-D" + i);
}
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index ac520ccc58d3..0c20d6b5d0bc 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -313,7 +313,9 @@ void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue)
{
osl::MutexGuard guard(registry_->mutex_);
std::vector< sal_Int32 > list;
- for (sal_Int32 i = 0; i < seqValue.getLength(); ++i) {
+ list.reserve(seqValue.getLength());
+ for (sal_Int32 i = 0; i < seqValue.getLength(); ++i)
+ {
list.push_back(seqValue[i]);
}
RegError err = key_.setLongListValue(
@@ -613,7 +615,9 @@ void Key::setStringListValue(
{
osl::MutexGuard guard(registry_->mutex_);
std::vector< sal_Unicode * > list;
- for (sal_Int32 i = 0; i < seqValue.getLength(); ++i) {
+ list.reserve(seqValue.getLength());
+ for (sal_Int32 i = 0; i < seqValue.getLength(); ++i)
+ {
list.push_back(const_cast< sal_Unicode * >(seqValue[i].getStr()));
}
RegError err = key_.setUnicodeListValue(