projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
713ca5f
)
Create &B::{IV,PV}::as_string using typeglob assignment rather than goto &
author
Nicholas Clark
<nick@ccl4.org>
Thu, 4 Nov 2010 14:21:05 +0000
(14:21 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Thu, 4 Nov 2010 14:21:05 +0000
(14:21 +0000)
Typeglob assignment avoids compiler work creating the optree for a second
subroutine, and runtime work executing that optree.
ext/B/B.pm
patch
|
blob
|
history
diff --git
a/ext/B/B.pm
b/ext/B/B.pm
index
4cd5545
..
587b809
100644
(file)
--- 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;