From: Vincent Pit Date: Wed, 10 Dec 2008 20:27:33 +0000 (+0100) Subject: Cleanup indirect_map_clean() recursion X-Git-Tag: v0.10~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=599ce6cd3e1c0e463b8e1bafb2538e824919e013;p=perl%2Fmodules%2Findirect.git Cleanup indirect_map_clean() recursion --- diff --git a/indirect.xs b/indirect.xs index c89c8b9..9acddcd 100644 --- a/indirect.xs +++ b/indirect.xs @@ -140,19 +140,23 @@ STATIC void indirect_map_delete(pTHX_ const OP *o) { hv_delete(indirect_map, buf, OP2STR(o), G_DISCARD); } -STATIC void indirect_map_clean(pTHX_ const OP *o) { -#define indirect_map_clean(O) indirect_map_clean(aTHX_ (O)) +STATIC void indirect_map_clean_kids(pTHX_ const OP *o) { +#define indirect_map_clean_kids(O) indirect_map_clean_kids(aTHX_ (O)) if (o->op_flags & OPf_KIDS) { const OP *kid = cUNOPo->op_first; for (; kid; kid = kid->op_sibling) { + indirect_map_clean_kids(kid); indirect_map_delete(kid); - indirect_map_clean(kid); } - } else { - indirect_map_delete(o); } } +STATIC void indirect_map_clean(pTHX_ const OP *o) { +#define indirect_map_clean(O) indirect_map_clean(aTHX_ (O)) + indirect_map_clean_kids(o); + indirect_map_delete(o); +} + STATIC const char *indirect_find(pTHX_ SV *sv, const char *s) { #define indirect_find(N, S) indirect_find(aTHX_ (N), (S)) STRLEN len;