Message97084
I checked the code, and it is the right thing:
Example 1 (fastsearch):
s, p = "ABCDEABCF", "BCD"
s.rfind(p)
# i = 6 is first candidate, but "BCF" != "BCD"
# then s[i-1] = "A" is not part of pattern
# so we skip 3 chars: next loop is i = 2
# etc...
Example 2 (msg97039):
s, p = "ABCDBCBCF", "BCB"
s.rfind(p)
# i = 6 is first candidate, but "BCF" != "BCB"
# then s[i-m] = "D" is not part of pattern
# so we skip 3 chars: next loop is i = 2.. and it fails!
I've tested many examples to understand and verify the algorithm. |
|
Date |
User |
Action |
Args |
2009-12-31 10:03:46 | flox | set | recipients:
+ flox, effbot, pitrou |
2009-12-31 10:03:46 | flox | set | messageid: <1262253826.13.0.505980552757.issue7462@psf.upfronthosting.co.za> |
2009-12-31 10:03:44 | flox | link | issue7462 messages |
2009-12-31 10:03:44 | flox | create | |
|