diff options
author | Andy Lester <andy@petdance.com> | 2005-12-22 10:38:39 -0600 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-12-23 00:06:52 +0000 |
commit | 4fc877accbeee7820b3c87ff559c82a99f60fe83 (patch) | |
tree | e36f487ff51d67d524503ea625df22a500423fc6 /util.c | |
parent | 64bb7586561259fcc353586ee951814f41b49333 (diff) | |
download | perl-4fc877accbeee7820b3c87ff559c82a99f60fe83.tar.gz |
Speedup (rn|n)?instr
Message-ID: <20051222223839.GI4370@petdance.com>
Date: Thu, 22 Dec 2005 16:38:39 -0600
p4raw-id: //depot/perl@26456
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -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) |