diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-10-31 16:58:51 +0100 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-10-31 16:58:51 +0100 |
| commit | f4c03fd8473c2b5a254789abcb712c90b558f92d (patch) | |
| tree | cd954625a031646b799768e1f2693f590ea3f14e /src/libsyntax_ext | |
| parent | 0db7abe5b6f3cdfca736f9238689cbea8ef61c7e (diff) | |
| download | rust-f4c03fd8473c2b5a254789abcb712c90b558f92d.tar.gz rust-f4c03fd8473c2b5a254789abcb712c90b558f92d.zip | |
syntax: improve a few allocations
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 002ecce58e6..dd90ef06c39 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -1384,7 +1384,7 @@ impl<'a> MethodDef<'a> { // let __self2_vi = unsafe { // std::intrinsics::discriminant_value(&arg2) } as i32; // ``` - let mut index_let_stmts: Vec<ast::Stmt> = Vec::new(); + let mut index_let_stmts: Vec<ast::Stmt> = Vec::with_capacity(vi_idents.len() + 1); // We also build an expression which checks whether all discriminants are equal // discriminant_test = __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... |
