X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=ptable.h;h=f3d2712e6b4e6d1d4e32a474e82fa6290db0e246;hp=ba275bac8c717523f844034a31336d817820aaaa;hb=8e1c49f42da7671812398f92d819da04c7a41e1b;hpb=8291ef989ac98ee2cb53a6098eed7aa7c3ed0ca8 diff --git a/ptable.h b/ptable.h index ba275ba..f3d2712 100644 --- a/ptable.h +++ b/ptable.h @@ -117,16 +117,6 @@ STATIC void *ptable_fetch(const ptable * const t, const void * const key) { } #endif /* !ptable_fetch */ -STATIC void PTABLE_PREFIX(_delete)(pPTBL_ const ptable * const t, const void * const key) { - ptable_ent *const ent = ptable_find(t, key); - - if (ent) { - void *val = ent->val; - PTABLE_VAL_FREE(val); - ent->val = NULL; - } -} - #ifndef ptable_split STATIC void ptable_split(pPTBLMS_ ptable * const t) { #define ptable_split(T) ptable_split(aPTBLMS_ (T)) @@ -165,7 +155,7 @@ STATIC void PTABLE_PREFIX(_store)(pPTBL_ ptable * const t, const void * const ke void *oldval = ent->val; PTABLE_VAL_FREE(oldval); ent->val = val; - } else { + } else if (val) { const UV i = PTABLE_HASH(key) & t->max; ent = PerlMemShared_malloc(sizeof *ent); ent->key = key;