From: Peter Rabbitson Date: Sun, 28 Oct 2012 11:09:04 +0000 (+0100) Subject: Stop reexamining own class twice under 'inherited' X-Git-Tag: v0.10007~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc8ab1f27da5ced46c64e40474d7dd5f0be49fd7;p=p5sagit%2FClass-Accessor-Grouped.git Stop reexamining own class twice under 'inherited' --- diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index 5f1c441..5fe4c3d 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -405,7 +405,10 @@ inherited from. This is what drives the traversal done by L. =cut sub get_super_paths { - return @{mro::get_linear_isa( ref($_[0]) || $_[0] )}; + # get_linear_isa returns the class itself as the 1st element + # use @_ as a pre-allocated scratch array + (undef, @_) = @{mro::get_linear_isa( length( ref($_[0]) ) ? ref($_[0]) : $_[0] )}; + @_; }; =head2 make_group_accessor