summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-13 15:06:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-14 19:14:19 +0200
commit22e08a3d8b043ce0ff2424d3fa0a704804afc567 (patch)
tree1ec23cb9304c2b6e074c3adfbdd5bb2873ae3267 /comphelper
parent2a274f47ee5759b17ab22497dbe64ef6135d4cd6 (diff)
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 <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/sequenceashashmap.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx
index b9662fbddbab..34a6a0c8a580 100644
--- a/comphelper/source/misc/sequenceashashmap.cxx
+++ b/comphelper/source/misc/sequenceashashmap.cxx
@@ -232,7 +232,7 @@ void SequenceAsHashMap::operator>>(css::uno::Sequence< css::beans::PropertyValue
pThis != end() ;
++pThis )
{
- pDestination[i].Name = pThis->first ;
+ pDestination[i].Name = pThis->first.maString;
pDestination[i].Value = pThis->second;
++i;
}
@@ -249,7 +249,7 @@ void SequenceAsHashMap::operator>>(css::uno::Sequence< css::beans::NamedValue >&
pThis != end() ;
++pThis )
{
- pDestination[i].Name = pThis->first ;
+ pDestination[i].Name = pThis->first.maString;
pDestination[i].Value = pThis->second;
++i;
}
@@ -283,7 +283,7 @@ bool SequenceAsHashMap::match(const SequenceAsHashMap& rCheck) const
{
for (auto const& elem : rCheck)
{
- const OUString& sCheckName = elem.first;
+ const OUString& sCheckName = elem.first.maString;
const css::uno::Any& aCheckValue = elem.second;
const_iterator pFound = find(sCheckName);
@@ -301,12 +301,9 @@ bool SequenceAsHashMap::match(const SequenceAsHashMap& rCheck) const
void SequenceAsHashMap::update(const SequenceAsHashMap& rUpdate)
{
m_aMap.reserve(std::max(size(), rUpdate.size()));
- for (auto const& elem : rUpdate)
+ for (auto const& elem : rUpdate.m_aMap)
{
- const OUString& sName = elem.first;
- const css::uno::Any& aValue = elem.second;
-
- (*this)[sName] = aValue;
+ m_aMap[elem.first] = elem.second;
}
}