summaryrefslogtreecommitdiff
path: root/overload.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-10-17 15:10:58 +0000
committerNicholas Clark <nick@ccl4.org>2007-10-17 15:10:58 +0000
commitd279ab826c469db5d93d3d728fdcf1acd9265665 (patch)
treeaddeb0185f58c60c5cfc3f8cecb80ea1c6b27088 /overload.c
parent7edb818e3f3ca1bd7fb46554919c8cfd222bd37d (diff)
downloadperl-d279ab826c469db5d93d3d728fdcf1acd9265665.tar.gz
Storing the length of all the overloading names saves a strlen() in a
loop in Perl_Gv_AMupdate(). Brought to you by the Campaign for the Elimination of strlen(). p4raw-id: //depot/perl@32124
Diffstat (limited to 'overload.c')
-rw-r--r--overload.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/overload.c b/overload.c
index 0a220cc4de..bb7f1cbeef 100644
--- a/overload.c
+++ b/overload.c
@@ -14,6 +14,76 @@
#define AMG_id2name(id) (PL_AMG_names[id]+1)
+const U8 PL_AMG_namelens[NofAMmeth] = {
+ 2,
+ 4,
+ 4,
+ 4,
+ 4,
+ 4,
+ 3,
+ 3,
+ 5,
+ 3,
+ 3,
+ 2,
+ 2,
+ 4,
+ 4,
+ 3,
+ 4,
+ 2,
+ 3,
+ 2,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 3,
+ 9,
+ 2,
+ 3,
+ 2,
+ 3,
+ 2,
+ 3,
+ 2,
+ 3,
+ 2,
+ 3,
+ 3,
+ 4,
+ 3,
+ 4,
+ 3,
+ 4,
+ 2,
+ 3,
+ 2,
+ 3,
+ 2,
+ 3,
+ 4,
+ 4,
+ 2,
+ 6,
+ 4,
+ 4,
+ 4,
+ 4,
+ 5,
+ 2,
+ 3,
+ 2,
+ 3,
+ 3,
+ 7
+};
+
char * const PL_AMG_names[NofAMmeth] = {
/* Names kept in the symbol table. fallback => "()", the rest has
"(" prepended. The only other place in perl which knows about