promote_consts: eargerly return when there are no candidates
There is no need to do it when mustn't.
This commit is contained in:
parent
28708912fb
commit
c03659443a
1 changed files with 5 additions and 0 deletions
|
@ -970,6 +970,11 @@ fn promote_candidates<'tcx>(
|
||||||
// Visit candidates in reverse, in case they're nested.
|
// Visit candidates in reverse, in case they're nested.
|
||||||
debug!(promote_candidates = ?candidates);
|
debug!(promote_candidates = ?candidates);
|
||||||
|
|
||||||
|
// eagerly fail fast
|
||||||
|
if candidates.is_empty() {
|
||||||
|
return IndexVec::new();
|
||||||
|
}
|
||||||
|
|
||||||
let mut promotions = IndexVec::new();
|
let mut promotions = IndexVec::new();
|
||||||
|
|
||||||
let mut extra_statements = vec![];
|
let mut extra_statements = vec![];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue