Use Vec::extend, instead of calling Vec::push in a loop

This commit is contained in:
Michael Howell 2021-11-11 13:56:32 -07:00
parent 3d29b68077
commit b0fd642de6

View File

@ -443,9 +443,7 @@ pub(super) fn column_count(&self) -> Option<usize> {
/// 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);
}