Re: hv.c patch - pathological hashes too easy
Tye McQueen [Thu, 1 May 2003 13:34:50 +0000 (08:34 -0500)]
From: "Tye McQueen" <tye@metronet.com>
Message-Id: <200305011834.h41IYoE08503@metronet.com>

p4raw-id: //depot/perl@19423

hv.c

diff --git a/hv.c b/hv.c
index 5abfc62..e018a75 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -703,8 +703,8 @@ Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val,
     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) */)
-           hsplit(hv);
+    } else if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */) {
+        hsplit(hv);
     }
 
     return &HeVAL(entry);