develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33928 - trunk/src

From:
chromatic
Date:
December 15, 2008 11:28
Subject:
[svn:parrot] r33928 - trunk/src
Message ID:
20081215192826.61E63CBADF@x12.develooper.com
Author: chromatic
Date: Mon Dec 15 11:28:25 2008
New Revision: 33928

Modified:
   trunk/src/string.c

Log:
[src] Delayed a string copy until absolutely necessary during an inplace chop.

Modified: trunk/src/string.c
==============================================================================
--- trunk/src/string.c	(original)
+++ trunk/src/string.c	Mon Dec 15 11:28:25 2008
@@ -1356,8 +1356,6 @@
     UINTVAL new_length, uchar_size;
     String_iter iter;
 
-    Parrot_unmake_COW(interp, s);
-
     if (n < 0) {
         new_length = -n;
         if (new_length > s->strlen)
@@ -1377,6 +1375,8 @@
         return;
     }
 
+    Parrot_unmake_COW(interp, s);
+
     uchar_size = s->bufused / s->strlen;
     s->strlen  = new_length;
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About