Commit cfc72ec
authored
⚡️ Speed up function
To optimize the given Python program, we will minimize redundant calls and utilize more efficient data manipulation.
### Changes.
1. Avoid redundant calls to `flag_env()` in `add_flag_env` by caching its value.
2. Use list comprehension where applicable for more concise and potentially faster list processing.
Here is the optimized version of the given Python program.generate__pystats by 11%1 parent 229d461 commit cfc72ec
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
0 commit comments