From eb772045f88ba8af8555f086b425225fbc891aa0 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Sun, 18 Nov 2018 10:44:25 +0100 Subject: [PATCH] sorted_map: add is_empty --- src/librustc_data_structures/sorted_map.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/librustc_data_structures/sorted_map.rs b/src/librustc_data_structures/sorted_map.rs index 5f45f430183..c8f85797191 100644 --- a/src/librustc_data_structures/sorted_map.rs +++ b/src/librustc_data_structures/sorted_map.rs @@ -143,6 +143,11 @@ impl SortedMap { self.data.len() } + #[inline] + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + #[inline] pub fn range(&self, range: R) -> &[(K, V)] where R: RangeBounds