Rollup merge of #82030 - LingMan:init_directly, r=varkor
Use `Iterator::all` instead of open-coding it Shorter code and by initializing to the final value directly, the variable doesn't need to be mut.
This commit is contained in:
commit
1ef566fc7c
@ -1382,14 +1382,8 @@ fn determine_place_ancestry_relation(
|
|||||||
// Assume of length of projections_b = m
|
// Assume of length of projections_b = m
|
||||||
let projections_b = &place_b.projections;
|
let projections_b = &place_b.projections;
|
||||||
|
|
||||||
let mut same_initial_projections = true;
|
let same_initial_projections =
|
||||||
|
projections_a.iter().zip(projections_b.iter()).all(|(proj_a, proj_b)| proj_a == proj_b);
|
||||||
for (proj_a, proj_b) in projections_a.iter().zip(projections_b.iter()) {
|
|
||||||
if proj_a != proj_b {
|
|
||||||
same_initial_projections = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if same_initial_projections {
|
if same_initial_projections {
|
||||||
// First min(n, m) projections are the same
|
// First min(n, m) projections are the same
|
||||||
|
Loading…
Reference in New Issue
Block a user