From: Jesse Luehrs Date: Sun, 24 Apr 2011 22:47:07 +0000 (-0500) Subject: remove unnecessary(?) code X-Git-Tag: 2.0100~33 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f4afc62a4744c96758cf21d234b654f5c273828;p=gitmo%2FMoose.git remove unnecessary(?) code not sure what the original intent was, but it's certainly not breaking any aliasing in this form --- diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index 661c454..44b1242 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -107,6 +107,10 @@ sub _inline_tc_code { shift->associated_attribute->_inline_tc_code(@_); } +sub _inline_check_coercion { + shift->associated_attribute->_inline_check_coercion(@_); +} + sub _inline_check_constraint { shift->associated_attribute->_inline_check_constraint(@_); } diff --git a/lib/Moose/Meta/Method/Accessor/Native/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Writer.pm index a3c8c35..165c619 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Writer.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Writer.pm @@ -116,18 +116,6 @@ around _inline_tc_code => sub { return $self->$orig(@_); }; -sub _inline_check_coercion { - my $self = shift; - my ($value, $tc, $tc_obj) = @_; - - my $attr = $self->associated_attribute; - return unless $attr->should_coerce && $attr->type_constraint->has_coercion; - - # We want to break the aliasing in @_ in case the coercion tries to make a - # destructive change to an array member. - return $value . ' = ' . $tc_obj . '->coerce(' . $value . ');'; -} - around _inline_check_constraint => sub { my $orig = shift; my $self = shift;