From: Andy Lester Date: Thu, 22 Dec 2005 16:38:39 +0000 (-0600) Subject: Speedup (rn|n)?instr X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4fc877accbeee7820b3c87ff559c82a99f60fe83;p=p5sagit%2Fp5-mst-13.2.git Speedup (rn|n)?instr Message-ID: <20051222223839.GI4370@petdance.com> Date: Thu, 22 Dec 2005 16:38:39 -0600 p4raw-id: //depot/perl@26456 --- diff --git a/util.c b/util.c index d8b28f2..5e5ba78 100644 --- a/util.c +++ b/util.c @@ -303,9 +303,11 @@ Perl_instr(pTHX_ register const char *big, register const char *little) for (x=big,s=little; *s; /**/ ) { if (!*x) return Nullch; - if (*s++ != *x++) { - s--; + if (*s != *x) break; + else { + s++; + x++; } } if (!*s) @@ -332,9 +334,11 @@ Perl_ninstr(pTHX_ register const char *big, register const char *bigend, const c if (*big++ != first) continue; for (x=big,s=little; s < littleend; /**/ ) { - if (*s++ != *x++) { - s--; + if (*s != *x) break; + else { + s++; + x++; } } if (s >= littleend) @@ -361,9 +365,11 @@ Perl_rninstr(pTHX_ register const char *big, const char *bigend, const char *lit if (*big-- != first) continue; for (x=big+2,s=little; s < littleend; /**/ ) { - if (*s++ != *x++) { - s--; + if (*s != *x) break; + else { + x++; + s++; } } if (s >= littleend)