Skip to content

Commit 3294a69

Browse files
committed
query: faster stack reversal in remove_cycle
1 parent e7b4bc3 commit 3294a69

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc/ty/query/job.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,9 @@ fn remove_cycle<'tcx>(
390390
DUMMY_SP,
391391
&mut stack,
392392
&mut visited) {
393-
// Reverse the stack so earlier entries require later entries
394-
stack.reverse();
395-
396-
// The stack is a vector of pairs of spans and queries
397-
let (mut spans, queries): (Vec<_>, Vec<_>) = stack.into_iter().unzip();
393+
// The stack is a vector of pairs of spans and queries; reverse it so that
394+
// the earlier entries require later entries
395+
let (mut spans, queries): (Vec<_>, Vec<_>) = stack.into_iter().rev().unzip();
398396

399397
// Shift the spans so that queries are matched with the span for their waitee
400398
spans.rotate_right(1);

0 commit comments

Comments
 (0)