summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2011-10-17 17:15:32 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2011-10-17 17:15:32 +0200
commitc49a809bf96a6f9d6e8f048bb237650dc7f6ccf9 (patch)
treee385f9593421eea86c4483eff8bce311671e4ce6 /hv.h
parente75ab6ad5d2255e4180c472f92ac3eaaec1fd200 (diff)
downloadperl-c49a809bf96a6f9d6e8f048bb237650dc7f6ccf9.tar.gz
Make HvENAME** macros smaller and more efficient
Brian's comments: if xhv_name_count == 1, HvENAME_HEK_NN returns null. So there's no need to use that macro twice. Just check for -1 The real need to make these smaller is the fact that some precompilers (e.g. HP-UX 10.20) cannot cope with the size these have grown to. The precompiler has since got an option (-Hnnn) to increase the macrospace but that option never made it to these old compilers. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/hv.h b/hv.h
index c38b493a0f..64eb5114e3 100644
--- a/hv.h
+++ b/hv.h
@@ -308,13 +308,13 @@ C<SV*>.
#define HvENAME_HEK(hv) \
(SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name ? HvENAME_HEK_NN(hv) : NULL)
#define HvENAME_get(hv) \
- ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
+ ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvAUX(hv)->xhv_name_count != -1) \
? HEK_KEY(HvENAME_HEK_NN(hv)) : NULL)
#define HvENAMELEN_get(hv) \
- ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
+ ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvAUX(hv)->xhv_name_count != -1) \
? HEK_LEN(HvENAME_HEK_NN(hv)) : 0)
#define HvENAMEUTF8(hv) \
- ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
+ ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvAUX(hv)->xhv_name_count != -1) \
? HEK_UTF8(HvENAME_HEK_NN(hv)) : 0)
/* the number of keys (including any placeholders) */