From: Andy Lester Date: Mon, 4 Jul 2005 14:12:00 +0000 (-0500) Subject: Remove unnecessary null check X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3abe233e1ceba6675710708c5678345cce24ac62;p=p5sagit%2Fp5-mst-13.2.git Remove unnecessary null check Message-ID: <20050704191200.GA2614@petdance.com> p4raw-id: //depot/perl@25079 --- diff --git a/embed.fnc b/embed.fnc index f300dba..4835671 100644 --- 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 --- 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 --- 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__;