8000 More precise comment · python/cpython@ed56aa0 · GitHub
[go: up one dir, main page]

Skip to content

Commit ed56aa0

Browse files
committed
More precise comment
1 parent f5afc66 commit ed56aa0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Objects/stringlib/fastsearch.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
it has actually checked for matches, but didn't find any. callers
1414
beware! */
1515

16-
/* If the needle is long enough, use Crochemore and Perrin's Two-Way
17-
algorithm, which has guaranteed O(n) runtime. Also compute a table
18-
of shifts to sometimes achieve O(n/m) runtime in the best cases. */
16+
/* If the strings are long enough, use Crochemore and Perrin's Two-Way
17+
algorithm, which has worst-case O(n) runtime and best-case O(n/k).
18+
Also compute a table of shifts to achieve O(n/k) in more cases,
19+
and often (data dependent) deduce larger shifts than pure C&P can
20+
deduce. */
1921

2022
#define FAST_COUNT 0
2123
#define FAST_SEARCH 1

0 commit comments

Comments
 (0)
0