From: Jesse Luehrs Date: Thu, 11 Nov 2010 15:11:48 +0000 (-0600) Subject: need to use a consistent sort order, now that this isn't cached X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FClass-MOP.git;a=commitdiff_plain;h=cc66fac6ef15584503dfcbc1953da2d58aad7989 need to use a consistent sort order, now that this isn't cached --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index fbe64e4..891e611 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -643,7 +643,7 @@ sub _inline_slot_initializers { my $idx = 0; return map { $self->_inline_slot_initializer($_, $idx++) } - $self->get_all_attributes; + sort { $a->name cmp $b->name } $self->get_all_attributes; } sub _inline_slot_initializer { diff --git a/lib/Class/MOP/Method/Constructor.pm b/lib/Class/MOP/Method/Constructor.pm index b64c1c5..31392dd 100644 --- a/lib/Class/MOP/Method/Constructor.pm +++ b/lib/Class/MOP/Method/Constructor.pm @@ -75,7 +75,10 @@ sub associated_metaclass { (shift)->{'associated_metaclass'} } sub _attributes { my $self = shift; - $self->{'attributes'} ||= [ $self->associated_metaclass->get_all_attributes ] + $self->{'attributes'} ||= [ + sort { $a->name cmp $b->name } + $self->associated_metaclass->get_all_attributes + ] } ## method