1
Fork 0

Various minor Idx-related tweaks

Nothing particularly exciting here, but a couple of things I noticed as I was looking for more index conversions to simplify.
This commit is contained in:
Scott McMurray 2023-04-16 01:06:55 -07:00
parent 2a71115261
commit c98895d9f2
17 changed files with 55 additions and 52 deletions

View file

@ -24,10 +24,7 @@ impl<K: DepKind> DepGraphQuery<K> {
pub fn push(&mut self, index: DepNodeIndex, node: DepNode<K>, edges: &[DepNodeIndex]) {
let source = self.graph.add_node(node);
if index.index() >= self.dep_index_to_index.len() {
self.dep_index_to_index.resize(index.index() + 1, None);
}
self.dep_index_to_index[index] = Some(source);
self.dep_index_to_index.insert(index, source);
self.indices.insert(node, source);
for &target in edges.iter() {