Use EntityMap instead of BTreeMap
This commit is contained in:
@@ -46,6 +46,7 @@ pub trait EntityRef: Copy + Eq {
|
||||
/// A *secondary* `EntityMap` contains additional data about entities kept in a primary map. The
|
||||
/// values need to implement `Clone + Default` traits so the map can be grown with `ensure`.
|
||||
///
|
||||
#[derive(Debug)]
|
||||
pub struct EntityMap<K, V>
|
||||
where K: EntityRef
|
||||
{
|
||||
@@ -76,6 +77,10 @@ impl<K, V> EntityMap<K, V>
|
||||
self.elems.push(v);
|
||||
k
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.elems.len()
|
||||
}
|
||||
}
|
||||
|
||||
/// Additional methods for value types that implement `Clone` and `Default`.
|
||||
|
||||
Reference in New Issue
Block a user