optimization question

Bernard Delmée bdelmee at advalvas._ZAPME_.be
Sun Aug 11 17:33:36 EDT 2002


>
> Oops, that should be s.find(t,i,j)
>

Right, but we'd still potentially scan megabytes.

How about: (s.find(t,i,min(j,i+len(t)) == i)

Erh... which, provided I got it right this time, isn't
nearly as obviously readable as the original test...





More information about the Python-list mailing list