Commit 4a63098
When parsing positional vs optional arguments, the use of min with a
list comprehension inside of a loop results in quadratic time based
on the number of optional arguments given. When combined with use of
prefix based argument files and a large number of optional flags, this
can result in extremely slow parsing behavior.
This replaces the min call with a simple loop with a short circuit to
break at the next optional argument.
Co-authored-by: Zsolt Dollenstein <[email protected]>
1 parent 7b47943 commit 4a63098
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2153 | 2153 | | |
2154 | 2154 | | |
2155 | 2155 | | |
2156 | | - | |
2157 | | - | |
2158 | | - | |
2159 | | - | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
2160 | 2161 | | |
2161 | 2162 | | |
2162 | 2163 | | |
| |||
0 commit comments