[svn:parrot] r47574 - in branches/gc_massacre/src/string: charset encoding
bacek at svn.parrot.org
bacek at svn.parrot.org
Sat Jun 12 21:23:52 UTC 2010
Author: bacek
Date: Sat Jun 12 21:23:52 2010
New Revision: 47574
URL: https://trac.parrot.org/parrot/changeset/47574
Log:
Avoid useless Parrot_str_copy call. Just create proper string.
Modified:
branches/gc_massacre/src/string/charset/ascii.c
branches/gc_massacre/src/string/charset/iso-8859-1.c
branches/gc_massacre/src/string/encoding/fixed_8.c
Modified: branches/gc_massacre/src/string/charset/ascii.c
==============================================================================
--- branches/gc_massacre/src/string/charset/ascii.c Sat Jun 12 21:23:38 2010 (r47573)
+++ branches/gc_massacre/src/string/charset/ascii.c Sat Jun 12 21:23:52 2010 (r47574)
@@ -267,9 +267,7 @@
{
ASSERT_ARGS(compose)
- STRING * const dest = Parrot_str_copy(interp, src);
-
- return dest;
+ return src;
}
/*
@@ -289,9 +287,7 @@
{
ASSERT_ARGS(decompose)
- STRING * const dest = Parrot_str_copy(interp, src);
-
- return dest;
+ return src;
}
/*
Modified: branches/gc_massacre/src/string/charset/iso-8859-1.c
==============================================================================
--- branches/gc_massacre/src/string/charset/iso-8859-1.c Sat Jun 12 21:23:38 2010 (r47573)
+++ branches/gc_massacre/src/string/charset/iso-8859-1.c Sat Jun 12 21:23:52 2010 (r47574)
@@ -283,9 +283,7 @@
{
ASSERT_ARGS(compose)
- STRING * const dest = Parrot_str_copy(interp, src);
-
- return dest;
+ return src;
}
/*
Modified: branches/gc_massacre/src/string/encoding/fixed_8.c
==============================================================================
--- branches/gc_massacre/src/string/encoding/fixed_8.c Sat Jun 12 21:23:38 2010 (r47573)
+++ branches/gc_massacre/src/string/encoding/fixed_8.c Sat Jun 12 21:23:52 2010 (r47574)
@@ -320,16 +320,10 @@
get_bytes(PARROT_INTERP, ARGIN(const STRING *src), UINTVAL offset, UINTVAL count)
{
ASSERT_ARGS(get_bytes)
- STRING * const return_string = Parrot_str_copy(interp, src);
-
- return_string->encoding = src->encoding;
- return_string->charset = src->charset;
-
- return_string->strstart = (char *)return_string->strstart + offset ;
- return_string->bufused = count;
-
- return_string->strlen = count;
- return_string->hashval = 0;
+ STRING * const return_string = Parrot_str_new_init(interp,
+ src->strstart + offset, count,
+ src->encoding, src->charset,
+ 0);
return return_string;
}
More information about the parrot-commits
mailing list