diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-01-18 10:57:44 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-01-18 10:57:44 -0800 |
commit | ca6102577e2112f9ab35a6504913f9234b4e8af7 (patch) | |
tree | dee289163d3e16323ff721591e5c1891532e6fa0 /lib/overload.pm | |
parent | fbed64679b5f70761a23ae7f56ae695d5c46e423 (diff) | |
download | perl-ca6102577e2112f9ab35a6504913f9234b4e8af7.tar.gz |
In overload::ov_method, use ‘no overloading’
Using this instead of Scalar::Util makes things marginally faster.
Diffstat (limited to 'lib/overload.pm')
-rw-r--r-- | lib/overload.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/overload.pm b/lib/overload.pm index 865a712fc6..a2797e71e9 100644 --- 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}); } |