commit | 73a85c4e1da42db28e3de57c868d24a089b8d277 | [log] [tgz] |
---|---|---|
author | Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> | Sun Feb 28 13:20:50 2021 -0500 |
committer | GitHub <noreply@github.com> | Sun Feb 28 12:20:50 2021 -0600 |
tree | ed2b044a2b8bd42bb611922bbcacbaf3599e91f9 | |
parent | 2183d06bc8a481098d62a4ebed8d6982b3d1602a [diff] |
bpo-41972: Use the two-way algorithm for string searching (GH-22904) Implement an enhanced variant of Crochemore and Perrin's Two-Way string searching algorithm, which reduces worst-case time from quadratic (the product of the string and pattern lengths) to linear. This applies to forward searches (like``find``, ``index``, ``replace``); the algorithm for reverse searches (like ``rfind``) is not changed. Co-authored-by: Tim Peters <tim.peters@gmail.com>