From: Nicholas Clark Date: Tue, 18 Aug 2009 10:36:02 +0000 (+0100) Subject: No need to flush the package's MRO cache if we've just flushed it. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7064c127ddaf90b0127815f523631025a6ab49af;p=p5sagit%2Fp5-mst-13.2.git No need to flush the package's MRO cache if we've just flushed it. --- diff --git a/lib/constant.pm b/lib/constant.pm index b77c085..255aa99 100644 --- a/lib/constant.pm +++ b/lib/constant.pm @@ -4,7 +4,7 @@ use strict; use warnings::register; use vars qw($VERSION %declared); -$VERSION = '1.18'; +$VERSION = '1.19'; #======================================================================= @@ -45,6 +45,7 @@ sub import { my $constants; my $multiple = ref $_[0]; my $pkg = caller; + my $done_mro; my $symtab; if (_CAN_PCS) { @@ -123,7 +124,8 @@ sub import { # constants from cv_const_sv are read only. So we have to: Internals::SvREADONLY($scalar, 1); $symtab->{$name} = \$scalar; - mro::method_changed_in($pkg); + # No need to flush the cache if we've just flushed it. + mro::method_changed_in($pkg) unless $done_mro++; } else { *$full_name = sub () { $scalar }; }