summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-12-22 10:38:39 -0600
committerNicholas Clark <nick@ccl4.org>2005-12-23 00:06:52 +0000
commit4fc877accbeee7820b3c87ff559c82a99f60fe83 (patch)
treee36f487ff51d67d524503ea625df22a500423fc6 /util.c
parent64bb7586561259fcc353586ee951814f41b49333 (diff)
downloadperl-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.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/util.c b/util.c
index d8b28f2140..5e5ba78465 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)