rustc/ty: move a faster early return up

This commit is contained in:
ljedrz 2018-10-01 15:44:23 +02:00
parent e153103c38
commit 0ee6b54c24
1 changed files with 5 additions and 5 deletions

View File

@ -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;