This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit 64ea348
Replace a few for loops with foreach to avoid loop cloning (#15668)
A pattern like
int len = a.Length;
for (int i = 0; i < len; i++) { ... a[i] ... }
may result in unnecessary loop cloning.
Anyway, there's no real reason to use a for loop in any of these case. Avois the need for a cast too.
Also remove duplicated code related to AppDomain.OnXResolveEvent method.1 parent 22658ba commit 64ea348
File tree
4 files changed
+14
-48
lines changed- src/mscorlib/src/System
- Reflection
- Runtime
- InteropServices/WindowsRuntime
- Loader
4 files changed
+14
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
| 514 | + | |
529 | 515 | | |
530 | 516 | | |
531 | 517 | | |
532 | 518 | | |
533 | 519 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
| 520 | + | |
549 | 521 | | |
550 | 522 | | |
551 | 523 | | |
552 | 524 | | |
553 | 525 | | |
554 | | - | |
| 526 | + | |
| 527 | + | |
555 | 528 | | |
| 529 | + | |
| 530 | + | |
556 | 531 | | |
557 | | - | |
558 | 532 | | |
559 | | - | |
560 | 533 | | |
561 | | - | |
562 | | - | |
563 | | - | |
| 534 | + | |
564 | 535 | | |
565 | | - | |
| 536 | + | |
566 | 537 | | |
567 | 538 | | |
568 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
680 | | - | |
681 | | - | |
| 679 | + | |
682 | 680 | | |
683 | | - | |
| 681 | + | |
684 | 682 | | |
685 | 683 | | |
686 | 684 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | | - | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
| 196 | + | |
198 | 197 | | |
199 | | - | |
| 198 | + | |
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
| |||
0 commit comments