diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-09-24 14:55:39 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-09-30 05:23:07 +1000 |
| commit | 85a56cbd88931db032417429d45c75d5049d0c2e (patch) | |
| tree | 13d3223af1a3bfae21dbb0927a03f2b63bb79809 | |
| parent | 4a7fb8b13ad9a42e96ebbeaef8ddc1ebca3d65c1 (diff) | |
| download | rust-85a56cbd88931db032417429d45c75d5049d0c2e.tar.gz rust-85a56cbd88931db032417429d45c75d5049d0c2e.zip | |
Inline `mark_as_waiting_from`.
It has a single call site, and the code is easier to read this way.
| -rw-r--r-- | src/librustc_data_structures/obligation_forest/mod.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs index de584a22e9c..3cf3bfc1fd4 100644 --- a/src/librustc_data_structures/obligation_forest/mod.rs +++ b/src/librustc_data_structures/obligation_forest/mod.rs @@ -570,7 +570,19 @@ impl<O: ForestObligation> ObligationForest<O> { #[inline(always)] fn inlined_mark_neighbors_as_waiting_from(&self, node: &Node<O>) { for &index in node.dependents.iter() { - self.mark_as_waiting_from(&self.nodes[index]); + let node = &self.nodes[index]; + match node.state.get() { + NodeState::Waiting | NodeState::Error => {} + NodeState::Success => { + node.state.set(NodeState::Waiting); + // This call site is cold. + self.uninlined_mark_neighbors_as_waiting_from(node); + } + NodeState::Pending | NodeState::Done => { + // This call site is cold. + self.uninlined_mark_neighbors_as_waiting_from(node); + } + } } } @@ -596,17 +608,6 @@ impl<O: ForestObligation> ObligationForest<O> { } } - fn mark_as_waiting_from(&self, node: &Node<O>) { - match node.state.get() { - NodeState::Waiting | NodeState::Error => return, - NodeState::Success => node.state.set(NodeState::Waiting), - NodeState::Pending | NodeState::Done => {}, - } - - // This call site is cold. - self.uninlined_mark_neighbors_as_waiting_from(node); - } - /// Compresses the vector, removing all popped nodes. This adjusts /// the indices and hence invalidates any outstanding /// indices. Cannot be used during a transaction. |
