From 22e08a3d8b043ce0ff2424d3fa0a704804afc567 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 May 2022 15:06:52 +0200 Subject: tdf#121740 cache hashcode in SequenceAsHashMap shaves 2% off load time Change-Id: I5bd4eabf61205df21a27d2822acd2676a7732a3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134315 Tested-by: Noel Grandin Reviewed-by: Noel Grandin --- embeddedobj/source/msole/olemisc.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'embeddedobj') diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx index 8f9a93a65cb4..e1007fbb13cc 100644 --- a/embeddedobj/source/msole/olemisc.cxx +++ b/embeddedobj/source/msole/olemisc.cxx @@ -677,11 +677,9 @@ void OleEmbeddedObject::initialize(const uno::Sequence& rArguments) return; comphelper::SequenceAsHashMap aValues(rArguments[0]); - for (const auto& rValue : aValues) - { - if (rValue.first == "StreamReadOnly") - rValue.second >>= m_bStreamReadOnly; - } + auto it = aValues.find("StreamReadOnly"); + if (it != aValues.end()) + it->second >>= m_bStreamReadOnly; } OUString SAL_CALL OleEmbeddedObject::getImplementationName() -- cgit v1.2.3