Remove unnecessary null check
Andy Lester [Mon, 4 Jul 2005 14:12:00 +0000 (09:12 -0500)]
Message-ID: <20050704191200.GA2614@petdance.com>

p4raw-id: //depot/perl@25079

embed.fnc
hv.c
proto.h

index f300dba..4835671 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -997,7 +997,7 @@ s   |void   |require_errno  |NN GV *gv
 
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
 s      |void   |hsplit         |NN HV *hv
-s      |void   |hfreeentries   |HV *hv
+s      |void   |hfreeentries   |NN HV *hv
 sa     |HE*    |new_he
 sa     |HEK*   |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
 s      |void   |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store
diff --git a/hv.c b/hv.c
index ee332c2..00aabc0 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1647,8 +1647,7 @@ S_hfreeentries(pTHX_ HV *hv)
     I32 riter;
     I32 max;
     struct xpvhv_aux *iter;
-    if (!hv)
-       return;
+
     if (!HvARRAY(hv))
        return;
 
diff --git a/proto.h b/proto.h
index ebee0b6..18250fc 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2009,7 +2009,9 @@ STATIC void       S_require_errno(pTHX_ GV *gv)
 STATIC void    S_hsplit(pTHX_ HV *hv)
                        __attribute__nonnull__(pTHX_1);
 
-STATIC void    S_hfreeentries(pTHX_ HV *hv);
+STATIC void    S_hfreeentries(pTHX_ HV *hv)
+                       __attribute__nonnull__(pTHX_1);
+
 STATIC HE*     S_new_he(pTHX)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;