From: Yuval Kogman Date: Tue, 22 Jul 2008 01:57:15 +0000 (+0000) Subject: Clean up option processing for Immutable X-Git-Tag: 0_64~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a84e3f334a1bda85d1e620ca1b9608395cf1180;p=gitmo%2FClass-MOP.git Clean up option processing for Immutable --- diff --git a/lib/Class/MOP/Immutable.pm b/lib/Class/MOP/Immutable.pm index 17874d9..0c11a37 100644 --- a/lib/Class/MOP/Immutable.pm +++ b/lib/Class/MOP/Immutable.pm @@ -73,17 +73,16 @@ my %DEFAULT_METHODS = ( sub make_metaclass_immutable { my ($self, $metaclass, $options) = @_; - foreach my $pair ( - [ inline_accessors => 1 ], - [ inline_constructor => 1 ], - [ inline_destructor => 0 ], - [ constructor_name => 'new' ], - [ debug => 0 ], - ) { - $options->{$pair->[0]} = $pair->[1] unless exists $options->{$pair->[0]}; - } + my %options = ( + inline_accessors => 1, + inline_constructor => 1, + inline_destructor => 0, + constructor_name => 'new', + debug => 0, + %$options, + ); - my %options = %$options; + %$options = %options; # FIXME who the hell is relying on this?!? tests fail =( if ($options{inline_accessors}) { foreach my $attr_name ($metaclass->get_attribute_list) {