go back to the older model of coherence collect
This commit is contained in:
parent
4b5613cb1d
commit
2fc15868a2
2 changed files with 43 additions and 19 deletions
|
|
@ -75,6 +75,21 @@ impl<M: DepTrackingMapConfig> DepTrackingMap<M> {
|
|||
pub fn keys(&self) -> Vec<M::Key> {
|
||||
self.map.keys().cloned().collect()
|
||||
}
|
||||
|
||||
/// Append `elem` to the vector stored for `k`, creating a new vector if needed.
|
||||
/// This is considered a write to `k`.
|
||||
///
|
||||
/// NOTE: Caution is required when using this method. You should
|
||||
/// be sure that nobody is **reading from the vector** while you
|
||||
/// are writing to it. Eventually, it'd be nice to remove this.
|
||||
pub fn push<E: Clone>(&mut self, k: M::Key, elem: E)
|
||||
where M: DepTrackingMapConfig<Value=Vec<E>>
|
||||
{
|
||||
self.write(&k);
|
||||
self.map.entry(k)
|
||||
.or_insert(Vec::new())
|
||||
.push(elem);
|
||||
}
|
||||
}
|
||||
|
||||
impl<M: DepTrackingMapConfig> MemoizationMap for RefCell<DepTrackingMap<M>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue