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:
1e44cfb
)
constant.pm: Remove redundant truth checks
author
Father Chrysostomos
<sprout@cpan.org>
Tue, 26 Aug 2014 04:45:50 +0000
(21:45 -0700)
committer
Father Chrysostomos
<sprout@cpan.org>
Tue, 26 Aug 2014 05:17:03 +0000
(22:17 -0700)
It is not possible to reach these without $symtab’s having been
assigned a stash reference.
dist/constant/lib/constant.pm
patch
|
blob
|
blame
|
history
diff --git
a/dist/constant/lib/constant.pm
b/dist/constant/lib/constant.pm
index
a838d7e
..
d1b32c5
100644
(file)
--- a/
dist/constant/lib/constant.pm
+++ b/
dist/constant/lib/constant.pm
@@
-162,7
+162,7
@@
sub import {
# The check in Perl_ck_rvconst knows that inlinable
# constants from cv_const_sv are read only. So we have to:
Internals::SvREADONLY($scalar, 1);
- if (
$symtab &&
!exists $symtab->{$name}) {
+ if (!exists $symtab->{$name}) {
$symtab->{$name} = \$scalar;
++$flush_mro->{$pkg};
}
@@
-178,7
+178,7
@@
sub import {
if (_CAN_PCS_FOR_ARRAY) {
_make_const($list[$_]) for 0..$#list;
_make_const(@list);
- if (
$symtab &&
!exists $symtab->{$name}) {
+ if (!exists $symtab->{$name}) {
$symtab->{$name} = \@list;
$flush_mro->{$pkg}++;
}