Skip to content

Commit b4df684

Browse files
committed
hv.h: Slight simplification of hv_fetch() macro
I think this is easier to read
1 parent 656be9b commit b4df684

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hv.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,12 @@ whether it is valid to call C<HvAUX()>.
558558
#define hv_exists(hv, key, klen) \
559559
cBOOL(hv_common_key_len((hv), (key), (klen), HV_FETCH_ISEXISTS, NULL, 0))
560560

561-
#define hv_fetch(hv, key, klen, lval) \
562-
((SV**) hv_common_key_len((hv), (key), (klen), (lval) \
563-
? (HV_FETCH_JUST_SV | HV_FETCH_LVALUE) \
564-
: HV_FETCH_JUST_SV, NULL, 0))
561+
#define hv_fetch(hv, key, klen, lval) \
562+
((SV**) hv_common_key_len((hv), (key), (klen), \
563+
(HV_FETCH_JUST_SV | ((lval) \
564+
? HV_FETCH_LVALUE \
565+
: 0)), \
566+
NULL, 0))
565567

566568
#define hv_delete(hv, key, klen, flags) \
567569
(MUTABLE_SV(hv_common_key_len((hv), (key), (klen), \

0 commit comments

Comments
 (0)