diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-05-09 16:34:54 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-05-09 16:58:41 -0400 |
commit | 825515439247853af3714d3135051a83bd84d2e0 (patch) | |
tree | e9dcb7914a83114f9885abce6deb883048c4e551 /src/metric.rs | |
parent | cccde01c4b4e376e0d1b5f58bdc9b1fe70a9b930 (diff) | |
download | kd-forest-825515439247853af3714d3135051a83bd84d2e0.tar.xz |
metric/forest: Use a flat staging buffer to reduce tree building overhead
Diffstat (limited to 'src/metric.rs')
-rw-r--r-- | src/metric.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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<T> ExhaustiveSearch<T> { 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<T> FromIterator<T> for ExhaustiveSearch<T> { |