query: minor refactoring
This commit is contained in:
parent
d7ca075881
commit
c2fa99d2c6
2 changed files with 3 additions and 10 deletions
|
@ -406,7 +406,7 @@ fn remove_cycle<'tcx>(
|
|||
|
||||
// Find the queries in the cycle which are
|
||||
// connected to queries outside the cycle
|
||||
let entry_points: Vec<_> = stack.iter().filter_map(|(span, query)| {
|
||||
let entry_points = stack.iter().filter_map(|(span, query)| {
|
||||
if query.parent.is_none() {
|
||||
// This query is connected to the root (it has no query parent)
|
||||
Some((*span, query.clone(), None))
|
||||
|
@ -431,10 +431,7 @@ fn remove_cycle<'tcx>(
|
|||
Some((*span, query.clone(), Some(waiter)))
|
||||
}
|
||||
}
|
||||
}).collect();
|
||||
|
||||
let entry_points: Vec<(Span, Lrc<QueryJob<'tcx>>, Option<(Span, Lrc<QueryJob<'tcx>>)>)>
|
||||
= entry_points;
|
||||
}).collect::<Vec<(Span, Lrc<QueryJob<'tcx>>, Option<(Span, Lrc<QueryJob<'tcx>>)>)>>();
|
||||
|
||||
// Deterministically pick an entry point
|
||||
let (_, entry_point, usage) = pick_query(tcx, &entry_points, |e| (e.0, e.1.clone()));
|
||||
|
|
|
@ -398,11 +398,7 @@ impl<'sess> OnDiskCache<'sess> {
|
|||
-> Option<T>
|
||||
where T: Decodable
|
||||
{
|
||||
let pos = if let Some(&pos) = index.get(&dep_node_index) {
|
||||
pos
|
||||
} else {
|
||||
return None
|
||||
};
|
||||
let pos = index.get(&dep_node_index).cloned()?;
|
||||
|
||||
// Initialize the cnum_map using the value from the thread which finishes the closure first
|
||||
self.cnum_map.init_nonlocking_same(|| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue