* Class::MOP::Method
- Add an "execute" method to invoke the body so
we can avoid using the coderef overload (Sartak)
+ * Class::MOP::Immutable
+ - Small speedup from eliminating several method
+ calls (Sartak)
0.71 Wed November 26, 2008
* Class::MOP::Class
my $self = shift;
my %methods = %DEFAULT_METHODS;
+ my $metaclass = $self->metaclass;
+ my $meta = $metaclass->meta;
foreach my $read_only_method (@{$self->options->{read_only}}) {
- my $method = $self->metaclass->meta->find_method_by_name($read_only_method);
+ my $method = $meta->find_method_by_name($read_only_method);
(defined $method)
- || confess "Could not find the method '$read_only_method' in " . $self->metaclass->name;
+ || confess "Could not find the method '$read_only_method' in " . $metaclass->name;
$methods{$read_only_method} = sub {
confess "This method is read-only" if scalar @_ > 1;
my $wrapped_methods = $self->options->{wrapped};
foreach my $method_name (keys %{ $wrapped_methods }) {
- my $method = $self->metaclass->meta->find_method_by_name($method_name);
+ my $method = $meta->find_method_by_name($method_name);
(defined $method)
- || confess "Could not find the method '$method_name' in " . $self->metaclass->name;
+ || confess "Could not find the method '$method_name' in " . $metaclass->name;
my $wrapper = $wrapped_methods->{$method_name};