From: Nicholas Clark Date: Sun, 17 Apr 2011 15:01:07 +0000 (+0100) Subject: check_new(st, NULL) always returns 0, so no need to check NULL before calling it X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e5c69bdd973a9534e92dc99f49cb497a14b1da50;hp=c1bfd7dae61a91bcc4e6b34a9c989cefe51c89ae;p=p5sagit%2FDevel-Size.git check_new(st, NULL) always returns 0, so no need to check NULL before calling it --- diff --git a/Size.xs b/Size.xs index d274230..4fed288 100644 --- a/Size.xs +++ b/Size.xs @@ -312,13 +312,12 @@ magic_size(const SV * const thing, struct state *st) { magic_pointer = SvMAGIC(thing); /* Have we seen the magic pointer? */ - while (magic_pointer && check_new(st, magic_pointer)) { + while (check_new(st, magic_pointer)) { st->total_size += sizeof(MAGIC); TRY_TO_CATCH_SEGV { /* Have we seen the magic vtable? */ - if (magic_pointer->mg_virtual && - check_new(st, magic_pointer->mg_virtual)) { + if (check_new(st, magic_pointer->mg_virtual)) { st->total_size += sizeof(MGVTBL); } @@ -659,10 +658,8 @@ thing_size(pTHX_ const SV * const orig_thing, struct state *st) { st->total_size += GvNAMELEN(thing); #ifdef GvFILE /* Is there a file? */ - if (GvFILE(thing)) { - if (check_new(st, GvFILE(thing))) { - st->total_size += strlen(GvFILE(thing)); - } + if (check_new(st, GvFILE(thing))) { + st->total_size += strlen(GvFILE(thing)); } #endif /* Is there something hanging off the glob? */