Finding one string inside another

Started by
10 comments, last by nino 22 years, 5 months ago
quote:Original post by Ysaneya
Looks like bullshit to me. The skip local array is never initialized, and the for i loop has no use.

Y.



Doesn't matter what it looks like to you. It works.


But you're correct in saying that first i-loop is totally unnecessary. It doesn't do anything.


Edited by - Red Ant on November 15, 2001 6:02:49 AM
Advertisement
You''re correct, that was a typo (or several) on my part. The correct loop should look like this:
  // Originally// for (i = 0; i < 255; i++) {//     for (j = 0; j < plen; j++)//         skip[P[j]] = plen - j - 1// }for (i = 0; i < 255; i++)    skip[i] = plen;for (i = 0; i < plen; i++)    skip[P[i]] = plen - i - 1;  


-Neophyte

- Death awaits you all with nasty, big, pointy teeth. -

This topic is closed to new replies.

Advertisement