From: Peter Rabbitson Date: Thu, 19 Mar 2009 23:52:58 +0000 (+0000) Subject: Slightly faster implementation of supers recalc check X-Git-Tag: v0.08003~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe63d7276ed1ff1f6b778565026a6d6b30a6e1e2;p=p5sagit%2FClass-Accessor-Grouped.git Slightly faster implementation of supers recalc check --- diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index b983975..df749a9 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -301,11 +301,12 @@ sub get_inherited { }; no strict 'refs'; + no warnings qw/uninitialized/; return ${$class.'::__cag_'.$_[1]} if defined(${$class.'::__cag_'.$_[1]}); # we need to be smarter about recalculation, as @ISA (thus supers) can very well change in-flight my $pkg_gen = mro::get_pkg_gen ($class); - if (!@{$class.'::__cag_supers'} or ${$class.'::__cag_pkg_gen'} != $pkg_gen ) { + if ( ${$class.'::__cag_pkg_gen'} != $pkg_gen ) { @{$class.'::__cag_supers'} = $_[0]->get_super_paths; ${$class.'::__cag_pkg_gen'} = $pkg_gen; };