[svn:parrot] r46038 - trunk/src/string

petdance at svn.parrot.org petdance at svn.parrot.org
Mon Apr 26 19:49:15 UTC 2010


Author: petdance
Date: Mon Apr 26 19:49:14 2010
New Revision: 46038
URL: https://trac.parrot.org/parrot/changeset/46038

Log:
consting, and hoisted a redundant macro call

Modified:
   trunk/src/string/api.c

Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c	Mon Apr 26 17:48:36 2010	(r46037)
+++ trunk/src/string/api.c	Mon Apr 26 19:49:14 2010	(r46038)
@@ -371,6 +371,7 @@
 {
     ASSERT_ARGS(Parrot_str_copy)
     STRING *d;
+    const int is_movable = PObj_is_movable_TESTALL(s);
 
     /* We set COW flag to avoid cloning buffer in compact_pool */
 
@@ -379,13 +380,13 @@
     STRUCT_COPY(d, s);
 
     /* Now check that buffer allocated from pool and affected by compacting */
-    if (PObj_is_movable_TESTALL(s)) {
+    if (is_movable) {
         /* If so, mark it as shared */
-        INTVAL *buffer_flags = Buffer_bufrefcountptr(d);
+        INTVAL * const buffer_flags = Buffer_bufrefcountptr(d);
         *buffer_flags |= Buffer_shared_FLAG;
     }
 
-    PARROT_ASSERT(PObj_is_movable_TESTALL(s) == PObj_is_movable_TESTALL(d));
+    PARROT_ASSERT(is_movable == PObj_is_movable_TESTALL(d));
 
     return d;
 }


More information about the parrot-commits mailing list