provisional MakeMaker patch for VMS
[p5sagit/p5-mst-13.2.git] / hv.c
diff --git a/hv.c b/hv.c
index 05f6deb..a5884e5 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -768,9 +768,6 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen, I32 flags)
            Perl_hv_notallowed(aTHX_ is_utf8, key, klen, keysave);
        }
 
-       *oentry = HeNEXT(entry);
-       if (i && !*oentry)
-           xhv->xhv_fill--; /* HvFILL(hv)-- */
        if (flags & G_DISCARD)
            sv = Nullsv;
        else {
@@ -790,6 +787,9 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen, I32 flags)
             * doesn't go down, but the number placeholders goes up */
            xhv->xhv_placeholders++; /* HvPLACEHOLDERS(hv)++ */
        } else {
+           *oentry = HeNEXT(entry);
+           if (i && !*oentry)
+               xhv->xhv_fill--; /* HvFILL(hv)-- */
            if (entry == xhv->xhv_eiter /* HvEITER(hv) */)
                HvLAZYDEL_on(hv);
            else
@@ -893,27 +893,23 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
        {
            if (SvREADONLY(hv))
                return Nullsv; /* if still SvREADONLY, leave it deleted. */
-           else {
-               // okay, really delete the placeholder.
-               *oentry = HeNEXT(entry);
-               if (i && !*oentry)
-                   xhv->xhv_fill--; /* HvFILL(hv)-- */
-               if (entry == xhv->xhv_eiter /* HvEITER(hv) */)
-                   HvLAZYDEL_on(hv);
-               else
-                   hv_free_ent(hv, entry);
-               xhv->xhv_keys--; /* HvKEYS(hv)-- */
-               xhv->xhv_placeholders--;
-               return Nullsv;
-           }
+
+           /* okay, really delete the placeholder. */
+           *oentry = HeNEXT(entry);
+           if (i && !*oentry)
+               xhv->xhv_fill--; /* HvFILL(hv)-- */
+           if (entry == xhv->xhv_eiter /* HvEITER(hv) */)
+               HvLAZYDEL_on(hv);
+           else
+               hv_free_ent(hv, entry);
+           xhv->xhv_keys--; /* HvKEYS(hv)-- */
+           xhv->xhv_placeholders--;
+           return Nullsv;
        }
        else if (SvREADONLY(hv) && HeVAL(entry) && SvREADONLY(HeVAL(entry))) {
            Perl_hv_notallowed(aTHX_ is_utf8, key, klen, keysave);
        }
 
-       *oentry = HeNEXT(entry);
-       if (i && !*oentry)
-           xhv->xhv_fill--; /* HvFILL(hv)-- */
        if (flags & G_DISCARD)
            sv = Nullsv;
        else {
@@ -933,6 +929,9 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
             * doesn't go down, but the number placeholders goes up */
            xhv->xhv_placeholders++; /* HvPLACEHOLDERS(hv)++ */
        } else {
+           *oentry = HeNEXT(entry);
+           if (i && !*oentry)
+               xhv->xhv_fill--; /* HvFILL(hv)-- */
            if (entry == xhv->xhv_eiter /* HvEITER(hv) */)
                HvLAZYDEL_on(hv);
            else