Commit ac0a8ca
committed
Avoid unnecessary Vec resize.
If `size > 0` current implementation will first create an empty
vec and then push an element into it, which will cause a resize
that can be easily avoided.
It's obviously not a big deal, but this also gets rid of `mut`
local variable.1 parent 5b9168a commit ac0a8ca
1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 30 | + | |
| 31 | + | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
| |||
0 commit comments