Repository: lucy-clownfish Updated Branches: refs/heads/0.6 5f6cb2448 -> 287f7ba06
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/52531b78 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/52531b78 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/52531b78 Branch: refs/heads/0.6 Commit: 52531b7884c5e65561dd3340f73bfb752a6734b8 Parents: 5f6cb24 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 15:05:43 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/52531b78/runtime/perl/lib/Clownfish.pm ---------------------------------------------------------------------- diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm index b7e6e60..6cb38d9 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;