summaryrefslogtreecommitdiff
path: root/lib/overload.pm
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-18 13:03:32 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-24 10:35:48 -0800
commit4403f0436417f874935b2f95d48b8fc6d7a7d624 (patch)
tree259beaff1c9749765e0f501bd2f0f0e09dccbe22 /lib/overload.pm
parenta75c6ed6bbe8051aad5c980a7e52906076b66543 (diff)
downloadperl-4403f0436417f874935b2f95d48b8fc6d7a7d624.tar.gz
In overload::AddrRef, use ‘no overloading’
This speeds this up by about 13 times.
Diffstat (limited to 'lib/overload.pm')
-rw-r--r--lib/overload.pm13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/overload.pm b/lib/overload.pm
index 90463b307e..77dfa66bfa 100644
--- a/lib/overload.pm
+++ b/lib/overload.pm
@@ -113,17 +113,8 @@ sub Method {
}
sub AddrRef {
- my $package = ref $_[0];
- return "$_[0]" unless $package;
-
- local $@;
- local $!;
- require Scalar::Util;
- my $class = Scalar::Util::blessed($_[0]);
- my $class_prefix = defined($class) ? "$class=" : "";
- my $type = Scalar::Util::reftype($_[0]);
- my $addr = Scalar::Util::refaddr($_[0]);
- return sprintf("%s%s(0x%x)", $class_prefix, $type, $addr);
+ no overloading;
+ "$_[0]";
}
*StrVal = *AddrRef;