note
GrandFather
<p>I doubt that even a pure C solution using this technique would be much faster. I haven't profiled it, but I'd guess most of the time is in the <c>index</c> and that is likely pretty efficient anyway.</p>
<p>I think some fussy code could handle the special case without impacting performance too much. The key would be detecting that a search sub-pattern was a repeating pattern and then "drifting" the pattern left by the repeat length to see if there is an earlier match against the target string than was found by <c>index</c>. Maybe I need to write some code so you see what I mean? :)</p>
<div class="pmsig"><div class="pmsig-461912">
<hr>Perl is Huffman encoded by design.
</div></div>
485464
486413