1
Fork 0

Rollup merge of #110394 - scottmcm:less-idx-new, r=WaffleLapkin

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.

cc https://github.com/rust-lang/compiler-team/issues/606
r? `@WaffleLapkin`
This commit is contained in:
Matthias Krüger 2023-04-17 18:13:35 +02:00 committed by GitHub
commit 0790996a07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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() {