summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-04-16 01:06:55 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-04-16 02:42:50 -0700
commitc98895d9f20eec10993bf2c3f07a2f2945228e49 (patch)
treeb1c752440e9426e5dbe210d473f28abdd4df559c /compiler/rustc_query_system
parent2a711152615ad9294dc0e5ee6885c8e9bb8418a9 (diff)
downloadrust-c98895d9f20eec10993bf2c3f07a2f2945228e49.tar.gz
rust-c98895d9f20eec10993bf2c3f07a2f2945228e49.zip
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.
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/dep_graph/query.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/query.rs b/compiler/rustc_query_system/src/dep_graph/query.rs
index 27b3b5e1366..9dcc41e2726 100644
--- a/compiler/rustc_query_system/src/dep_graph/query.rs
+++ b/compiler/rustc_query_system/src/dep_graph/query.rs
@@ -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() {