don't iterate over all impls when none match
before: 573.01user 4.04system 7:33.86elapsed 127%CPU (0avgtext+0avgdata 1141656maxresident)k after: 567.03user 4.00system 7:28.23elapsed 127%CPU (0avgtext+0avgdata 1133112maxresident)k an additional 1% improvement
This commit is contained in:
parent
8aeaaac654
commit
13809ffff7
1 changed files with 5 additions and 6 deletions
|
|
@ -3222,13 +3222,12 @@ impl<'tcx> TraitDef<'tcx> {
|
|||
for &impl_def_id in impls {
|
||||
f(impl_def_id);
|
||||
}
|
||||
return; // we don't need to process the other non-blanket impls
|
||||
}
|
||||
}
|
||||
|
||||
for v in self.nonblanket_impls.borrow().values() {
|
||||
for &impl_def_id in v {
|
||||
f(impl_def_id);
|
||||
} else {
|
||||
for v in self.nonblanket_impls.borrow().values() {
|
||||
for &impl_def_id in v {
|
||||
f(impl_def_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue