diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-04-16 01:06:55 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-04-16 02:42:50 -0700 |
| commit | c98895d9f20eec10993bf2c3f07a2f2945228e49 (patch) | |
| tree | b1c752440e9426e5dbe210d473f28abdd4df559c /compiler/rustc_query_system | |
| parent | 2a711152615ad9294dc0e5ee6885c8e9bb8418a9 (diff) | |
| download | rust-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.rs | 5 |
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() { |
