configmgr/source/config_map.hxx | 5 ++--- configmgr/source/nodemap.cxx | 7 ++++--- configmgr/source/nodemap.hxx | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-)
New commits: commit c400311414fca20d3705ee9ef24747b9a5301167 Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Tue May 17 10:46:45 2022 +0300 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue May 17 10:48:20 2022 +0200 Revert "use boost::flat_map in config_map" Fixes build breakage on macOS at least. Noel said it was OK to revert. This reverts commit cc4325f84a0ba35d8bbb564512bce0c6b8aab408. Change-Id: Ib78d29fc21d4d030b4032955b18271de1761f396 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134458 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/configmgr/source/config_map.hxx b/configmgr/source/config_map.hxx index f968165736d1..5d2990d5a0d8 100644 --- a/configmgr/source/config_map.hxx +++ b/configmgr/source/config_map.hxx @@ -9,7 +9,7 @@ #ifndef CONFIG_MAP_HXX #define CONFIG_MAP_HXX -#include <boost/container/flat_map.hpp> +#include <map> #include <rtl/ustring.hxx> // The realisation here is that while a map is a reasonably compact @@ -28,8 +28,7 @@ struct LengthContentsCompare } }; -template <class T> -struct config_map : public boost::container::flat_map<OUString, T, LengthContentsCompare> +template <class T> struct config_map : public std::map<OUString, T, LengthContentsCompare> { }; diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx index 0b524846bfcd..e21578b2880b 100644 --- a/configmgr/source/nodemap.cxx +++ b/configmgr/source/nodemap.cxx @@ -42,9 +42,10 @@ void NodeMap::cloneInto(NodeMap* target) const rtl::Reference<Node> NodeMap::findNode(int layer, OUString const& name) const { - if (!moCache || (*moCache)->first != name) - moCache = const_cast<NodeMap*>(this)->maImpl.find(name); - const_iterator i = *moCache; + const_iterator i; + if (maCache == end() || maCache->first != name) + maCache = const_cast<NodeMap*>(this)->maImpl.find(name); + i = maCache; return i == end() || i->second->getLayer() > layer ? rtl::Reference<Node>() : i->second; } } diff --git a/configmgr/source/nodemap.hxx b/configmgr/source/nodemap.hxx index b03a6503bb22..19447c7f77f7 100644 --- a/configmgr/source/nodemap.hxx +++ b/configmgr/source/nodemap.hxx @@ -23,7 +23,6 @@ #include "config_map.hxx" #include <rtl/ref.hxx> #include "node.hxx" -#include <optional> namespace configmgr { @@ -60,8 +59,8 @@ class NodeMap private: // We get a large number of repeated identical lookups. - mutable std::optional<const_iterator> moCache; - void clearCache() { moCache.reset(); } + mutable const_iterator maCache; + void clearCache() { maCache = maImpl.end(); } }; }