Repository: lucy-clownfish Updated Branches: refs/heads/master 3b8ace378 -> 120ece10e
Prepare for CV-in-stash optimization in Perl 5.28. Perl 5.28 will start to store subroutines in stashes as coderefs. See https://rt.perl.org/Public/Bug/Display.html?id=129916 https://rt.perl.org/Public/Bug/Display.html?id=132252 https://perl5.git.perl.org/perl.git/commitdiff/7d65f652cb Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/f30ed78a Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/f30ed78a Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/f30ed78a Branch: refs/heads/master Commit: f30ed78acd52df8425914b618430fe8816f226c8 Parents: 3b8ace3 Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Fri Oct 27 15:03:40 2017 +0200 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Tue Nov 14 13:43:19 2017 +0100 ---------------------------------------------------------------------- runtime/perl/lib/Clownfish.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f30ed78a/runtime/perl/lib/Clownfish.pm ---------------------------------------------------------------------- diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm index 8873e4b..3209be2 100644 --- a/runtime/perl/lib/Clownfish.pm +++ b/runtime/perl/lib/Clownfish.pm @@ -80,9 +80,11 @@ sub error {$Clownfish::Err::error} my $stash = \%{"$package\::"}; my $methods = Clownfish::Vector->new( capacity => scalar keys %$stash ); - while ( my ( $symbol, $glob ) = each %$stash ) { - next if ref $glob; - next unless *$glob{CODE}; + while ( my ( $symbol, $entry ) = each %$stash ) { + # A subroutine is stored in the CODE slot of a typeglob. Since + # Perl 5.28 it may also be stored as a coderef. + next unless ref($entry) eq 'CODE' + || ( ref(\$entry) eq 'GLOB' && *$entry{CODE} ); $methods->push( Clownfish::String->new($symbol) ); } return $methods;