From 825515439247853af3714d3135051a83bd84d2e0 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 9 May 2020 16:34:54 -0400 Subject: metric/forest: Use a flat staging buffer to reduce tree building overhead --- src/metric.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/metric.rs') diff --git a/src/metric.rs b/src/metric.rs index ff996b9..d37d2bf 100644 --- a/src/metric.rs +++ b/src/metric.rs @@ -368,6 +368,11 @@ impl ExhaustiveSearch { pub fn push(&mut self, item: T) { self.0.push(item); } + + /// Get the size of this index. + pub fn len(&self) -> usize { + self.0.len() + } } impl FromIterator for ExhaustiveSearch { -- cgit v1.2.3