This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbed646
)
In overload::ov_method, use ‘no overloading’
author
Father Chrysostomos
<sprout@cpan.org>
Wed, 18 Jan 2012 18:57:44 +0000
(10:57 -0800)
committer
Father Chrysostomos
<sprout@cpan.org>
Wed, 18 Jan 2012 18:57:44 +0000
(10:57 -0800)
Using this instead of Scalar::Util makes things marginally faster.
lib/overload.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/overload.pm
b/lib/overload.pm
index
865a712
..
a2797e7
100644
(file)
--- a/
lib/overload.pm
+++ b/
lib/overload.pm
@@
-82,9
+82,8
@@
sub ov_method {
my $globref = shift;
return undef unless $globref;
my $sub = \&{*$globref};
- require Scalar::Util;
- return $sub
- if Scalar::Util::refaddr($sub) != Scalar::Util::refaddr(\&nil);
+ no overloading;
+ return $sub if !ref $sub or $sub != \&nil;
return shift->can($ {*$globref});
}