summaryrefslogtreecommitdiff
path: root/configmgr/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2022-05-17 10:46:45 +0300
committerCaolán McNamara <caolanm@redhat.com>2022-05-17 10:48:20 +0200
commitc400311414fca20d3705ee9ef24747b9a5301167 (patch)
treecde814824ca15adc470d243e20bf44eb15793794 /configmgr/source
parent9969b7ee3413b4c83f6e93d92e1038daeaf649e8 (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'configmgr/source')
-rw-r--r--configmgr/source/config_map.hxx5
-rw-r--r--configmgr/source/nodemap.cxx7
-rw-r--r--configmgr/source/nodemap.hxx5
3 files changed, 8 insertions, 9 deletions
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(); }
};
}