summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-27 17:58:10 +0200
committerNicholas Clark <nick@ccl4.org>2011-07-01 14:05:40 +0200
commit75fc7bf602cd498829b35780623ebe139c0a0483 (patch)
tree63b0614fc1223a0d33bb7947ab2072a979e9f537 /util.c
parent56e9eeb1a239fc995bf33475e31f8379bd01cbad (diff)
downloadperl-75fc7bf602cd498829b35780623ebe139c0a0483.tar.gz
Merge PL_scream{first,next} into one allocated buffer.
Effectively, PL_screamnext is now PL_screamfirst + 256. The actual interpreter variable PL_screamnext is eliminated.
Diffstat (limited to 'util.c')
-rw-r--r--util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/util.c b/util.c
index 9185e08308..e099fdafab 100644
--- a/util.c
+++ b/util.c
@@ -861,6 +861,7 @@ Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift
register I32 stop_pos;
register const unsigned char *littleend;
I32 found = 0;
+ const I32 *screamnext = PL_screamfirst + 256;
PERL_ARGS_ASSERT_SCREAMINSTR;
@@ -868,7 +869,7 @@ Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift
assert(SvVALID(littlestr));
pos = *old_posp == -1
- ? PL_screamfirst[BmRARE(littlestr)] : PL_screamnext[*old_posp];
+ ? PL_screamfirst[BmRARE(littlestr)] : screamnext[*old_posp];
if (pos == -1) {
cant_find:
if ( BmRARE(littlestr) == '\n'
@@ -901,7 +902,7 @@ Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift
return NULL;
}
while (pos < previous + start_shift) {
- pos = PL_screamnext[pos];
+ pos = screamnext[pos];
if (pos == -1)
goto cant_find;
}
@@ -922,7 +923,7 @@ Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift
found = 1;
}
}
- pos = PL_screamnext[pos];
+ pos = screamnext[pos];
} while (pos != -1);
if (last && found)
return (char *)(big+(*old_posp));