Commit dbad6cf
committed
Replace full list evaluations with more efficient calls
- UP027: Replace unpacked list comprehensions with generator
expressions; these are supposedly more efficient since no temporary
list is created.
- RUF015: Replace accessing the first element of an evaluated list with
`next(iter(...))`, avoiding the temporary list.
- RUF017: Replace quadratic `sum(list of list, [])` with faster
`functools.reduce` implementation.1 parent f734bb5 commit dbad6cf
File tree
18 files changed
+35
-32
lines changed- lib
- matplotlib
- axes
- backends
- tests
- mpl_toolkits/mplot3d/tests
- tools
18 files changed
+35
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
1290 | 1291 | | |
1291 | 1292 | | |
1292 | 1293 | | |
1293 | | - | |
| 1294 | + | |
| 1295 | + | |
1294 | 1296 | | |
1295 | 1297 | | |
1296 | 1298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6000 | 6000 | | |
6001 | 6001 | | |
6002 | 6002 | | |
6003 | | - | |
| 6003 | + | |
6004 | 6004 | | |
6005 | 6005 | | |
6006 | 6006 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
731 | | - | |
732 | | - | |
| 731 | + | |
| 732 | + | |
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
1200 | | - | |
1201 | | - | |
| 1200 | + | |
| 1201 | + | |
1202 | 1202 | | |
1203 | 1203 | | |
1204 | 1204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3086 | 3086 | | |
3087 | 3087 | | |
3088 | 3088 | | |
3089 | | - | |
| 3089 | + | |
3090 | 3090 | | |
3091 | 3091 | | |
3092 | | - | |
| 3092 | + | |
3093 | 3093 | | |
3094 | 3094 | | |
3095 | 3095 | | |
| |||
0 commit comments