X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fconstant.pm;h=a51ee7f277dd8eb32d71b21f0e7dd7667b6d59c8;hb=9915814ae2fdb84b23ea0d5e658a8e037cda2031;hp=24a6603bbc1c780ef81710e67f20123ab615f583;hpb=81a8de77c95e1a449aaa4780c3e993117e10733d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/constant.pm b/lib/constant.pm index 24a6603..a51ee7f 100644 --- a/lib/constant.pm +++ b/lib/constant.pm @@ -117,7 +117,9 @@ sub import { $declared{$full_name}++; if ($multiple || @_ == 1) { my $scalar = $multiple ? $constants->{$name} : $_[0]; - if ($symtab && !exists $symtab->{$name}) { + # The constant serves to optimise this entire block out on + # 5.8 and earlier. + if (_CAN_PCS && $symtab && !exists $symtab->{$name}) { # No typeglob yet, so we can use a reference as space- # efficient proxy for a constant subroutine # The check in Perl_ck_rvconst knows that inlinable @@ -137,7 +139,7 @@ sub import { } } # Flush the cache exactly once if we make any direct symbol table changes. - mro::method_changed_in($pkg) if $flush_mro; + mro::method_changed_in($pkg) if _CAN_PCS && $flush_mro; } 1;