Commit f11502c
committed
Auto merge of #26904 - bluss:no-repeat, r=alexcrichton
In a followup to PR #26849, improve one more location for I/O where
we can use `Vec::resize` to ensure better performance when zeroing
buffers.
Use the `vec![elt; n]` macro everywhere we can in the tree. It replaces
`repeat(elt).take(n).collect()` which is more verbose, requires type
hints, and right now produces worse code. `vec![]` is preferable for vector
initialization.
The `vec![]` replacement touches upon one I/O path too, Stdin::read
for windows, and that should be a small improvement.
r? @alexcrichtonFile tree
32 files changed
+64
-93
lines changed- src
- libcollectionstest
- libcollections
- libcoretest
- libgraphviz
- librand
- librustc_back
- librustc_data_structures
- librustc_trans/trans
- librustc_typeck
- check
- method
- librustc/middle
- infer/region_inference
- librustdoc/html
- libstd
- collections/hash
- io
- sys/windows
- libsyntax
- ext
- print
- test
- bench
- run-pass
32 files changed
+64
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1318 | 1318 | | |
1319 | 1319 | | |
1320 | 1320 | | |
1321 | | - | |
| 1321 | + | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | 1324 | | |
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | | - | |
| 1422 | + | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
| |||
1467 | 1467 | | |
1468 | 1468 | | |
1469 | 1469 | | |
1470 | | - | |
| 1470 | + | |
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
| |||
1479 | 1479 | | |
1480 | 1480 | | |
1481 | 1481 | | |
1482 | | - | |
| 1482 | + | |
1483 | 1483 | | |
1484 | 1484 | | |
1485 | 1485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
| 130 | + | |
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
603 | 602 | | |
604 | 603 | | |
605 | 604 | | |
| |||
647 | 646 | | |
648 | 647 | | |
649 | 648 | | |
650 | | - | |
| 649 | + | |
651 | 650 | | |
652 | 651 | | |
653 | 652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
| 707 | + | |
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
865 | | - | |
| 865 | + | |
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| |||
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
878 | | - | |
| 878 | + | |
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
| |||
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
| 892 | + | |
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
239 | 238 | | |
240 | 239 | | |
241 | 240 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
511 | 510 | | |
512 | 511 | | |
513 | 512 | | |
514 | | - | |
| 513 | + | |
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
1304 | 1303 | | |
1305 | 1304 | | |
1306 | 1305 | | |
1307 | | - | |
| 1306 | + | |
1308 | 1307 | | |
1309 | 1308 | | |
1310 | 1309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
566 | 565 | | |
567 | 566 | | |
568 | 567 | | |
569 | | - | |
570 | | - | |
| 568 | + | |
| 569 | + | |
571 | 570 | | |
572 | 571 | | |
573 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
258 | | - | |
| 257 | + | |
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
| |||
534 | 533 | | |
535 | 534 | | |
536 | 535 | | |
537 | | - | |
538 | 536 | | |
539 | 537 | | |
540 | 538 | | |
| |||
613 | 611 | | |
614 | 612 | | |
615 | 613 | | |
616 | | - | |
| 614 | + | |
617 | 615 | | |
618 | 616 | | |
619 | 617 | | |
| |||
0 commit comments