Perl_scalarvoid remove duplicate SvNV call
authorDaniel Dragan <bulk88@hotmail.com>
Fri, 19 Sep 2014 21:44:07 +0000 (17:44 -0400)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 20 Sep 2014 14:43:23 +0000 (07:43 -0700)
op.c

diff --git a/op.c b/op.c
index 163b6a8..7e7d667 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1730,6 +1730,7 @@ Perl_scalarvoid(pTHX_ OP *o)
            no_bareword_allowed(o);
        else {
            if (ckWARN(WARN_VOID)) {
+               NV nv;
                /* don't warn on optimised away booleans, eg 
                 * use constant Foo, 5; Foo || print; */
                if (cSVOPo->op_private & OPpCONST_SHORTCIRCUIT)
@@ -1737,7 +1738,7 @@ Perl_scalarvoid(pTHX_ OP *o)
                /* the constants 0 and 1 are permitted as they are
                   conventionally used as dummies in constructs like
                        1 while some_condition_with_side_effects;  */
-               else if (SvNIOK(sv) && (SvNV(sv) == 0.0 || SvNV(sv) == 1.0))
+               else if (SvNIOK(sv) && ((nv = SvNV(sv)) == 0.0 || nv == 1.0))
                    useless = NULL;
                else if (SvPOK(sv)) {
                     SV * const dsv = newSVpvs("");