Duplicate 19423 (pathological hashes too easy) into share_hek_flags
Nicholas Clark [Thu, 16 Oct 2003 19:31:19 +0000 (19:31 +0000)]
(as suggested by Jan Dubois)

p4raw-id: //depot/perl@21469

hv.c

diff --git a/hv.c b/hv.c
index 5e2a385..965b6ae 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -2288,7 +2288,7 @@ S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags)
        xhv->xhv_keys++; /* HvKEYS(hv)++ */
        if (i) {                                /* initial entry? */
            xhv->xhv_fill++; /* HvFILL(hv)++ */
-           if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */)
+       } else if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */) {
                hsplit(PL_strtab);
        }
     }