This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7bff8c3
)
In S_pad_check_dup(), no need to check the 0th name entry.
author
Nicholas Clark
<nick@ccl4.org>
Wed, 17 Nov 2010 10:58:46 +0000
(10:58 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Wed, 17 Nov 2010 10:58:46 +0000
(10:58 +0000)
The 0th entry in a pad is for @_, and the name corresponding to it is NULL,
so save a check.
pad.c
patch
|
blob
|
blame
|
history
diff --git
a/pad.c
b/pad.c
index
2c1c81d
..
06cadbb
100644
(file)
--- a/
pad.c
+++ b/
pad.c
@@
-662,7
+662,7
@@
S_pad_check_dup(pTHX_ SV *name, const U32 flags, const HV *ourstash)
}
/* check the rest of the pad */
if (is_our) {
-
do
{
+
while (off > 0)
{
SV * const sv = svp[off];
if (sv
&& sv != &PL_sv_undef
@@
-678,7
+678,8
@@
S_pad_check_dup(pTHX_ SV *name, const U32 flags, const HV *ourstash)
"\t(Did you mean \"local\" instead of \"our\"?)\n");
break;
}
- } while ( off-- > 0 );
+ --off;
+ }
}
}