From b0fd642de61f23e0913c8476840e5921d7802309 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 11 Nov 2021 13:56:32 -0700 Subject: [PATCH] Use `Vec::extend`, instead of calling `Vec::push` in a loop --- compiler/rustc_mir_build/src/thir/pattern/usefulness.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs index d959d2f7f6f..b253108f3dc 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs @@ -443,9 +443,7 @@ pub(super) fn column_count(&self) -> Option { /// 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); }