1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

A few tweaks to bmhsearch prior to the branch out.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@408 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
zedshaw 2006-11-25 01:25:04 +00:00
parent 7f17c43dab
commit 86aac04128

View file

@ -299,9 +299,6 @@ VALUE BMHSearch_find(VALUE self, VALUE hay)
rb_raise(eBMHSearchError, "Corrupt search state. REALLY BAD!");
}
/* Start searching from the end of S->needle (this is not a typo) */
hpos = S->nlen-1;
/* Check for a trailing remainder, which is only possible if skip > 1 */
if(S->skip) {
// only scan for what should be the rest of the string
@ -315,6 +312,9 @@ VALUE BMHSearch_find(VALUE self, VALUE hay)
}
/* Start searching from the end of S->needle (this is not a typo) */
hpos = S->nlen-1;
while(hpos < hlen) {
/* Compare the S->needle backwards, and stop when first mismatch is found */
npos = S->nlen-1;