Commit 04032ab
authored
Rollup merge of rust-lang#136816 - yotamofek:pr/notable-traits-button-cleanup, r=aDotInTheVoid
refactor `notable_traits_button` to use iterator combinators instead of for loop
~Small cleanup.
Use `Iterator::any` instead of `for` loop with `predicate = true;`.
I think this makes the code more readable... and also has the additional benefit of short-circuiting the iterator when a notable trait is found (a `break` statement was missing in the `for` loop version, I think). Probably won't be significant enough to show on perf results, though.~
Three commits, each attempting to optimize `notable_trait_buttons` by a little bit.1 file changed
+11
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | | - | |
1469 | | - | |
1470 | 1468 | | |
1471 | 1469 | | |
1472 | 1470 | | |
| |||
1484 | 1482 | | |
1485 | 1483 | | |
1486 | 1484 | | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1495 | 1491 | | |
1496 | 1492 | | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
1508 | 1498 | | |
1509 | 1499 | | |
1510 | 1500 | | |
| |||
0 commit comments