From 4403f0436417f874935b2f95d48b8fc6d7a7d624 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 18 Jan 2012 13:03:32 -0800 Subject: =?UTF-8?q?In=20overload::AddrRef,=20use=20=E2=80=98no=20overloadi?= =?UTF-8?q?ng=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This speeds this up by about 13 times. --- lib/overload.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'lib/overload.pm') 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; -- cgit v1.2.1