let mut unused_changes = Vec::new();
'outer: for x in btree::rev_iter(&self.txn, &c, None)? {
let (_, p) = x?;
for chan in self.iter_channels("").map_err(|e| e.0)? {
let (name, chan) = chan.map_err(|e| e.0)?;
if name.as_str() == name0 {
continue
}
let chan = chan.read().unwrap();
if self.channel_has_state(&chan.states, &p.b).map_err(|e| e.0)?.is_some() {
break 'outer
}
if self.get_changeset(&chan.changes, &p.a).map_err(|e| e.0)?.is_some() {
continue 'outer
}
}
unused_changes.push(p.a);
}
for ch in unused_changes.iter() {
while btree::del(&mut self.txn, &mut self.dep, ch, None)? {}
while btree::del(&mut self.txn, &mut self.revdep, ch, None)? {}
}