From: Nicholas Clark Date: Thu, 4 Nov 2010 14:21:05 +0000 (+0000) Subject: Create &B::{IV,PV}::as_string using typeglob assignment rather than goto & X-Git-Tag: accepted/trunk/20130322.191538~6936 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e4a84deaa95967a479c4ba292f52f944552cb1f;p=platform%2Fupstream%2Fperl.git 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. --- 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;