[svn:parrot] r47354 - trunk/src/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Fri Jun 4 15:52:18 UTC 2010


Author: NotFound
Date: Fri Jun  4 15:52:18 2010
New Revision: 47354
URL: https://trac.parrot.org/parrot/changeset/47354

Log:
modify Boolean init_pmc to shorten it and allow better coverage

Modified:
   trunk/src/pmc/boolean.pmc

Modified: trunk/src/pmc/boolean.pmc
==============================================================================
--- trunk/src/pmc/boolean.pmc	Fri Jun  4 15:10:11 2010	(r47353)
+++ trunk/src/pmc/boolean.pmc	Fri Jun  4 15:52:18 2010	(r47354)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2007, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -35,12 +35,8 @@
 
 */
     VTABLE void init_pmc(PMC *value) {
-        if (!PMC_IS_NULL(value)) {
-            SELF.set_bool(VTABLE_get_bool(INTERP, value));
-        }
-        else {
-            SELF.set_bool(0);
-        }
+        INTVAL v = PMC_IS_NULL(value) ? (INTVAL) 0 : VTABLE_get_bool(INTERP, value);
+        SELF.set_bool(v);
     }
 /*
 


More information about the parrot-commits mailing list