From 0e4a84deaa95967a479c4ba292f52f944552cb1f Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 4 Nov 2010 14:21:05 +0000 Subject: [PATCH] Create &B::{IV,PV}::as_string using typeglob assignment rather than goto & Typeglob assignment avoids compiler work creating the optree for a second subroutine, and runtime work executing that optree. --- ext/B/B.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/B/B.pm b/ext/B/B.pm index 4cd5545..587b809 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -105,8 +105,8 @@ sub B::IV::int_value { } sub B::NULL::as_string() {""} -sub B::IV::as_string() {goto &B::IV::int_value} -sub B::PV::as_string() {goto &B::PV::PV} +*B::IV::as_string = \&B::IV::int_value; +*B::PV::as_string = \&B::PV::PV; my $debug; my $op_count = 0; -- 2.7.4