Author: petdance
Date: Mon Feb 25 18:47:36 2008
New Revision: 26063

Modified:
   trunk/src/pmc/float.pmc
   trunk/src/pmc/integer.pmc

Log:
a little consting

Modified: trunk/src/pmc/float.pmc
==============================================================================
--- trunk/src/pmc/float.pmc     (original)
+++ trunk/src/pmc/float.pmc     Mon Feb 25 18:47:36 2008
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2003-2007, The Perl Foundation.
+Copyright (C) 2003-2008, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -46,13 +46,11 @@
 
 */
     PMC *new_from_string(STRING *rep, INTVAL flags) {
-        PMC *res;
         const INTVAL type = SELF->vtable->base_type;
-
-        if (flags & PObj_constant_FLAG)
-            res = constant_pmc_new(INTERP, type);
-        else
-            res = pmc_new(INTERP, type);
+        PMC * const res =
+            (flags & PObj_constant_FLAG)
+                ? constant_pmc_new(INTERP, type)
+                : pmc_new(INTERP, type);
 
         PMC_num_val(res) = string_to_num(INTERP, rep);
         return res;

Modified: trunk/src/pmc/integer.pmc
==============================================================================
--- trunk/src/pmc/integer.pmc   (original)
+++ trunk/src/pmc/integer.pmc   Mon Feb 25 18:47:36 2008
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2003-2007, The Perl Foundation.
+Copyright (C) 2003-2008, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -117,13 +117,11 @@
 
 */
     PMC *new_from_string(STRING *rep, INTVAL flags) {
-        PMC *res;
         const INTVAL type = SELF->vtable->base_type;
-
-        if (flags & PObj_constant_FLAG)
-            res = constant_pmc_new(INTERP, type);
-        else
-            res = pmc_new(INTERP, type);
+        PMC * const res =
+            (flags & PObj_constant_FLAG)
+                ? constant_pmc_new(INTERP, type)
+                : pmc_new(INTERP, type);
 
         /* RT#46623 bigint overflow */
         PMC_int_val(res) = string_to_int(INTERP, rep);

Reply via email to