From: Nicholas Clark Date: Wed, 4 May 2011 20:37:24 +0000 (+0200) Subject: Simplify magic_size() by knowing that check_new() returns false for NULL. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=980c657644f4f9525127afb1a2d332545a20e0df;p=p5sagit%2FDevel-Size.git Simplify magic_size() by knowing that check_new() returns false for NULL. --- diff --git a/Size.xs b/Size.xs index 127152f..8373101 100644 --- a/Size.xs +++ b/Size.xs @@ -312,18 +312,9 @@ cc_opclass(const OP * const o) size */ static void magic_size(pTHX_ const SV * const thing, struct state *st) { - MAGIC *magic_pointer; + MAGIC *magic_pointer = SvMAGIC(thing); - /* Is there any? */ - if (!SvMAGIC(thing)) { - /* No, bail */ - return; - } - - /* Get the base magic pointer */ - magic_pointer = SvMAGIC(thing); - - /* Have we seen the magic pointer? */ + /* Have we seen the magic pointer? (NULL has always been seen before) */ while (check_new(st, magic_pointer)) { st->total_size += sizeof(MAGIC);