Skip to content

Commit b0fd642

Browse files
committed
Use Vec::extend, instead of calling Vec::push in a loop
1 parent 3d29b68 commit b0fd642

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_mir_build/src/thir/pattern/usefulness.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,7 @@ impl<'p, 'tcx> Matrix<'p, 'tcx> {
443443
/// expands it.
444444
fn push(&mut self, row: PatStack<'p, 'tcx>) {
445445
if !row.is_empty() && row.head().is_or_pat() {
446-
for row in row.expand_or_pat() {
447-
self.patterns.push(row);
448-
}
446+
self.patterns.extend(row.expand_or_pat());
449447
} else {
450448
self.patterns.push(row);
451449
}

0 commit comments

Comments
 (0)