diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-15 13:01:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-15 21:39:58 +0200 |
commit | cc4325f84a0ba35d8bbb564512bce0c6b8aab408 (patch) | |
tree | 3176a56fd68c3f9d689a8244a4d118a7484c8a66 /configmgr/source/nodemap.cxx | |
parent | 3c140247d1477d565680731434df7b82d01f4775 (diff) |
use boost::flat_map in config_map
reduces time spent allocating
Change-Id: Idd571db62d28be7e48672f76d741174a7ab40959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134346
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'configmgr/source/nodemap.cxx')
-rw-r--r-- | configmgr/source/nodemap.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx index e21578b2880b..0b524846bfcd 100644 --- a/configmgr/source/nodemap.cxx +++ b/configmgr/source/nodemap.cxx @@ -42,10 +42,9 @@ void NodeMap::cloneInto(NodeMap* target) const rtl::Reference<Node> NodeMap::findNode(int layer, OUString const& name) const { - const_iterator i; - if (maCache == end() || maCache->first != name) - maCache = const_cast<NodeMap*>(this)->maImpl.find(name); - i = maCache; + if (!moCache || (*moCache)->first != name) + moCache = const_cast<NodeMap*>(this)->maImpl.find(name); + const_iterator i = *moCache; return i == end() || i->second->getLayer() > layer ? rtl::Reference<Node>() : i->second; } } |