Skip to content

Commit 0ee6b54

Browse files
committed
rustc/ty: move a faster early return up
1 parent e153103 commit 0ee6b54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc/ty/query/job.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -324,16 +324,16 @@ fn connected_to_root<'tcx>(
324324
query: Lrc<QueryJob<'tcx>>,
325325
visited: &mut FxHashSet<*const QueryJob<'tcx>>
326326
) -> bool {
327-
// We already visited this or we're deliberately ignoring it
328-
if visited.contains(&query.as_ptr()) {
329-
return false;
330-
}
331-
332327
// This query is connected to the root (it has no query parent), return true
333328
if query.parent.is_none() {
334329
return true;
335330
}
336331

332+
// We already visited this or we're deliberately ignoring it
333+
if visited.contains(&query.as_ptr()) {
334+
return false;
335+
}
336+
337337
visited.insert(query.as_ptr());
338338

339339
let mut connected = false;

0 commit comments

Comments
 (0)