Include map length in diagnostics

This commit is contained in:
Manish Goregaokar 2017-10-20 15:00:17 -07:00
parent f7f898b3b3
commit a10329f8ff
3 changed files with 11 additions and 2 deletions

View file

@ -896,6 +896,10 @@ impl<K, V> RawTable<K, V> {
}
}
pub fn diagnostic_count_hashes(&self) -> usize {
(0..self.capacity()).filter(|&i| unsafe { *self.raw_bucket_at(i).hash() != EMPTY_BUCKET }).count()
}
pub fn iter(&self) -> Iter<K, V> {
Iter {
iter: self.raw_buckets(),