1
Fork 0

Auto merge of #90813 - notriddle:notriddle/vec-extend, r=GuillaumeGomez

Use Vec extend and collect instead of repeatedly calling push
This commit is contained in:
bors 2021-11-12 12:13:32 +00:00
commit f31622a50b
2 changed files with 28 additions and 27 deletions

View file

@ -443,9 +443,7 @@ impl<'p, 'tcx> Matrix<'p, 'tcx> {
/// expands it.
fn push(&mut self, row: PatStack<'p, 'tcx>) {
if !row.is_empty() && row.head().is_or_pat() {
for row in row.expand_or_pat() {
self.patterns.push(row);
}
self.patterns.extend(row.expand_or_pat());
} else {
self.patterns.push(row);
}