Repository navigation
Commit 7639558
committed
gh-160556: Fix quadratic time in csv.Sniffer with long runs of spaces
Sniffer._split_dormant() tried a match at every space of a run of
spaces when the space was a candidate delimiter, and rescanned the
rest of the run each time. A match starting at a space preceded by a
space is never the leftmost one, so skip those positions with a
lookbehind. The results do not change.
The regression was introduced in gh-83273 (25fea6d).1 parent dc28c3a commit 7639558
3 files changed
Lines changed: 14 additions & 2 deletions
File tree
- Lib
- test
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
441 | 444 | | |
442 | | - | |
| 445 | + | |
443 | 446 | | |
444 | 447 | | |
445 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1631 | 1631 | | |
1632 | 1632 | | |
1633 | 1633 | | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1634 | 1641 | | |
1635 | 1642 | | |
1636 | 1643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments