1
Fork 0

Rollup merge of #108681 - nnethercote:needs_process_obligation-comments, r=lqd

Improve comments in `needs_process_obligation`.

And a couple of other places.

r? `@lqd`
This commit is contained in:
Matthias Krüger 2023-03-03 20:45:02 +01:00 committed by GitHub
commit 37bd50eddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 24 deletions

View file

@ -426,6 +426,7 @@ impl<O: ForestObligation> ObligationForest<O> {
// nodes. Therefore we use a `while` loop.
let mut index = 0;
while let Some(node) = self.nodes.get_mut(index) {
// This test is extremely hot.
if node.state.get() != NodeState::Pending
|| !processor.needs_process_obligation(&node.obligation)
{
@ -439,6 +440,7 @@ impl<O: ForestObligation> ObligationForest<O> {
// out of sync with `nodes`. It's not very common, but it does
// happen, and code in `compress` has to allow for it.
// This code is much less hot.
match processor.process_obligation(&mut node.obligation) {
ProcessResult::Unchanged => {
// No change in state.