From 7364cbbdea110d3c7b1656290b4c0a746a95cfe4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 18 Sep 2020 20:52:16 +0100 Subject: tdf#136559 We can get a performance boost from using a ListStore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of a TreeStore if we only need a list see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2693 Change-Id: I03d03f2364ccc75b87d3f7c31d21ac9993fb384b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103036 Tested-by: Jenkins Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106878 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos --- include/o3tl/sorted_vector.hxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/o3tl') diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx index 088f5a2aa214..28ef75817fa7 100644 --- a/include/o3tl/sorted_vector.hxx +++ b/include/o3tl/sorted_vector.hxx @@ -198,6 +198,11 @@ public: return (ret.second) ? ret.first : m_vector.end(); } + size_type count(const Value& v) const + { + return find(v) != end() ? 1 : 0; + } + bool operator==(const sorted_vector & other) const { return m_vector == other.m_vector; -- cgit v1.2.3