[svn:parrot] r48091 - branches/gsoc_nfg/src/string

darbelo at svn.parrot.org darbelo at svn.parrot.org
Thu Jul 15 00:05:05 UTC 2010


Author: darbelo
Date: Thu Jul 15 00:05:05 2010
New Revision: 48091
URL: https://trac.parrot.org/parrot/changeset/48091

Log:
Avoid needless, roundabout transcoding operations in concatenation.

Modified:
   branches/gsoc_nfg/src/string/api.c

Modified: branches/gsoc_nfg/src/string/api.c
==============================================================================
--- branches/gsoc_nfg/src/string/api.c	Wed Jul 14 23:07:33 2010	(r48090)
+++ branches/gsoc_nfg/src/string/api.c	Thu Jul 15 00:05:05 2010	(r48091)
@@ -471,8 +471,10 @@
         else
             enc = Parrot_utf8_encoding_ptr;
 
-        a = Parrot_unicode_charset_ptr->to_charset(interp, a);
-        b = Parrot_unicode_charset_ptr->to_charset(interp, b);
+        if (a->charset != cs)
+            a = cs->to_charset(interp, a);
+        if (b->charset != cs)
+            b = cs->to_charset(interp, b);
 
         if (a->encoding != enc)
             a = enc->to_encoding(interp, a);


More information about the parrot-commits mailing list