From 9c2715ffda93a7625955a453a6dacaa4b601dd89 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 28 Apr 2020 11:44:10 +0200 Subject: BLI: add Map.is_empty() method --- source/blender/blenlib/BLI_map.hh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenlib/BLI_map.hh') diff --git a/source/blender/blenlib/BLI_map.hh b/source/blender/blenlib/BLI_map.hh index 553175b0395..eb9c6372995 100644 --- a/source/blender/blenlib/BLI_map.hh +++ b/source/blender/blenlib/BLI_map.hh @@ -415,6 +415,14 @@ class Map { return m_array.slots_set(); } + /** + * Returns true if there are no elements in the map. + */ + bool is_empty() const + { + return this->size() == 0; + } + /** * Calls the given function for each key-value-pair. */ -- cgit v1.2.3