diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-09-20 12:13:16 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-09-20 12:13:16 +0000 |
commit | 4c2df08ca7dcec8d9dadbf994c085e23d96957a3 (patch) | |
tree | c12c69e6cae735fc84bc1a5acadd1c971cc1ff23 /hv.c | |
parent | 6b4de9074f35c313f7b151542a4d1bbf6fd263a2 (diff) | |
download | perl-4c2df08ca7dcec8d9dadbf994c085e23d96957a3.tar.gz |
Convert hv_delete_ent(), hv_exists_ent(), hv_fetch_ent() and
hv_store_ent() to macros, and consign the function bodies to history.
Er, mathoms.c
p4raw-id: //depot/perl@31924
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 32 |
1 files changed, 1 insertions, 31 deletions
@@ -258,7 +258,7 @@ Perl_hv_store(pTHX_ HV *hv, const char *key, I32 klen_i32, SV *val, U32 hash) return hek ? &HeVAL(hek) : NULL; } -/* XXX This looks like an ideal candidate to inline */ +/* Tricky to inlike this because it needs a temporary variable */ SV** Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val, register U32 hash, int flags) @@ -297,13 +297,6 @@ information on how to use this function on tied hashes. =cut */ -/* XXX This looks like an ideal candidate to inline */ -HE * -Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, U32 hash) -{ - return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISSTORE, val, hash); -} - /* =for apidoc hv_exists @@ -374,14 +367,6 @@ computed. =cut */ -/* XXX This looks like an ideal candidate to inline */ -bool -Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash) -{ - return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISEXISTS, 0, hash) - ? TRUE : FALSE; -} - /* returns an HE * structure with the all fields set */ /* note that hent_val will be a mortal sv for MAGICAL hashes */ /* @@ -402,13 +387,6 @@ information on how to use this function on tied hashes. */ HE * -Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash) -{ - return hv_common(hv, keysv, NULL, 0, 0, - (lval ? HV_FETCH_LVALUE : 0), NULL, hash); -} - -HE * Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, int flags, int action, SV *val, register U32 hash) { @@ -974,14 +952,6 @@ precomputed hash value, or 0 to ask for it to be computed. =cut */ -/* XXX This looks like an ideal candidate to inline */ -SV * -Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash) -{ - return (SV *) hv_common(hv, keysv, NULL, 0, 0, flags | HV_DELETE, NULL, - hash); -} - STATIC SV * S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, int k_flags, I32 d_flags, U32 hash) |