projects
/
gitmo/Class-MOP.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Big optimization for get_method_list
[gitmo/Class-MOP.git]
/
lib
/
Class
/
MOP
/
Mixin
/
HasMethods.pm
diff --git
a/lib/Class/MOP/Mixin/HasMethods.pm
b/lib/Class/MOP/Mixin/HasMethods.pm
index
8e38d5e
..
bc5b09c
100644
(file)
--- a/
lib/Class/MOP/Mixin/HasMethods.pm
+++ b/
lib/Class/MOP/Mixin/HasMethods.pm
@@
-149,7
+149,11
@@
sub remove_method {
sub get_method_list {
my $self = shift;
- return grep { $self->has_method($_) } keys %{ $self->namespace };
+
+ my $namespace = $self->namespace;
+
+ return grep { *{ $namespace->{$_} }{CODE} && $self->has_method($_) }
+ keys %{$namespace};
}
1;