Use Vec::extend
, instead of calling Vec::push
in a loop
This commit is contained in:
parent
3d29b68077
commit
b0fd642de6
1 changed files with 1 additions and 3 deletions
|
@ -443,9 +443,7 @@ impl<'p, 'tcx> Matrix<'p, 'tcx> {
|
||||||
/// expands it.
|
/// expands it.
|
||||||
fn push(&mut self, row: PatStack<'p, 'tcx>) {
|
fn push(&mut self, row: PatStack<'p, 'tcx>) {
|
||||||
if !row.is_empty() && row.head().is_or_pat() {
|
if !row.is_empty() && row.head().is_or_pat() {
|
||||||
for row in row.expand_or_pat() {
|
self.patterns.extend(row.expand_or_pat());
|
||||||
self.patterns.push(row);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
self.patterns.push(row);
|
self.patterns.push(row);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue