Skip to content

Commit

Permalink
rustc/ty: move a faster early return up
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Oct 5, 2018
1 parent e153103 commit 0ee6b54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/librustc/ty/query/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,16 @@ fn connected_to_root<'tcx>(
query: Lrc<QueryJob<'tcx>>,
visited: &mut FxHashSet<*const QueryJob<'tcx>>
) -> bool {
// We already visited this or we're deliberately ignoring it
if visited.contains(&query.as_ptr()) {
return false;
}

// This query is connected to the root (it has no query parent), return true
if query.parent.is_none() {
return true;
}

// We already visited this or we're deliberately ignoring it
if visited.contains(&query.as_ptr()) {
return false;
}

visited.insert(query.as_ptr());

let mut connected = false;
Expand Down

0 comments on commit 0ee6b54

Please sign in to comment.