Commit 8008407
committed
⚡✅ Update all net-imap regexps to run in O(n)
The BIDI_FAILURE regexps all used `\g<name>` to define char classes and
then re-use them. Unfortunately, ruby 3.2 can't compile that to run in
linear time. The regexps could also be written using lookahead, but
that also wouldn't run in linear time.
The debug output gsub is simple to accomplish without negative lookahead
by using a block with gsub and checking `$'.empty?`.
`bin/check-regexps` was added for quick double-check, just in case the
tests aren't catching everything.1 parent 92db350 commit 8008407
File tree
6 files changed
+43
-79
lines changed- bin
- lib/net
- imap/stringprep
- rakelib
- test/net/imap
6 files changed
+43
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2443 | 2443 | | |
2444 | 2444 | | |
2445 | 2445 | | |
2446 | | - | |
2447 | | - | |
| 2446 | + | |
| 2447 | + | |
2448 | 2448 | | |
2449 | 2449 | | |
2450 | 2450 | | |
| |||
Large diffs are not rendered by default.
0 commit comments