From: Dave Rolsky Date: Wed, 4 Jan 2012 06:52:16 +0000 (-0600) Subject: small code formatting tweaks X-Git-Tag: v0.17~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b60c40bd27a81249ffaae24e6cb8b6423364bcf;p=gitmo%2FMooseX-StrictConstructor.git small code formatting tweaks --- diff --git a/lib/MooseX/StrictConstructor/Trait/Class.pm b/lib/MooseX/StrictConstructor/Trait/Class.pm index b96e5fd..aea38bd 100644 --- a/lib/MooseX/StrictConstructor/Trait/Class.pm +++ b/lib/MooseX/StrictConstructor/Trait/Class.pm @@ -32,7 +32,7 @@ around new_object => sub { return $instance; }; -around '_inline_BUILDALL' => sub { +around _inline_BUILDALL => sub { my $orig = shift; my $self = shift; diff --git a/lib/MooseX/StrictConstructor/Trait/Method/Constructor.pm b/lib/MooseX/StrictConstructor/Trait/Method/Constructor.pm index ae5d3fb..8d8590f 100644 --- a/lib/MooseX/StrictConstructor/Trait/Method/Constructor.pm +++ b/lib/MooseX/StrictConstructor/Trait/Method/Constructor.pm @@ -6,19 +6,18 @@ use namespace::autoclean; use B (); -around '_generate_BUILDALL' => sub { +around _generate_BUILDALL => sub { my $orig = shift; my $self = shift; my $source = $self->$orig(); $source .= ";\n" if $source; - my @attrs = ( - '__INSTANCE__ => 1,', - map { B::perlstring($_) . ' => 1,' } - grep {defined} - map { $_->init_arg() } @{ $self->_attributes() } - ); + my @attrs = '__INSTANCE__ => 1,'; + push @attrs, map { B::perlstring($_) . ' => 1,' } + grep { defined } + map { $_->init_arg() } @{ $self->_attributes() }; + $source .= <<"EOF"; my \%attrs = (@attrs);