From: Shawn M Moore Date: Fri, 15 Jun 2012 18:53:55 +0000 (-0500) Subject: Remove some needless indirection X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c4818f913a659fa69fb1108cebbb82561050e7d;p=gitmo%2FMoose.git Remove some needless indirection --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index f0156fd..9bea601 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -41,12 +41,6 @@ sub does { return $self->Moose::Object::does($name); } -sub _error_thrower { - my $self = shift; - require Moose::Meta::Class; - ( ref $self && $self->associated_class ) || "Moose::Meta::Class"; -} - sub throw_error { my $self = shift; Moose::Util::throw(@_); @@ -55,11 +49,10 @@ sub throw_error { sub _inline_throw_error { my ( $self, $msg, $args ) = @_; - my $inv = $self->_error_thrower; - # XXX ugh - $inv = 'Moose::Meta::Class' unless $inv->can('_inline_throw_error'); - - return $inv->_inline_throw_error($msg, $args) + return 'Moose::Util::throw(' . + 'message => ' . $msg . + ($args ? (', ' . $args) : '') + . ');'; } sub new {