aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string.c
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2009-05-27 15:38:02 -0700
committerKen Thompson <ken@golang.org>2009-05-27 15:38:02 -0700
commit64c3fe05bf16ea9107be5a7e4257db86addb6d08 (patch)
tree53679547ef5d85a5c4f7302329f7e0817efcd87c /src/runtime/string.c
parent18890eebbf27fec3b004478fc23443bbd349ba6d (diff)
downloadgo-64c3fe05bf16ea9107be5a7e4257db86addb6d08.tar.xz
string([]int) conversion
R=r OCL=29466 CL=29466
Diffstat (limited to 'src/runtime/string.c')
-rw-r--r--src/runtime/string.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/runtime/string.c b/src/runtime/string.c
index d7393ef6ed..04cf06bc3c 100644
--- a/src/runtime/string.c
+++ b/src/runtime/string.c
@@ -181,6 +181,28 @@ sys·arraystring(Array b, String s)
FLUSH(&s);
}
+void
+sys·arraystringi(Array b, String s)
+{
+ int32 siz, i;
+ int32 *a;
+ byte dum[8];
+
+ a = (int32*)b.array;
+ siz = 0;
+ for(i=0; i<b.nel; i++) {
+ siz += runetochar(dum, a[i]);
+ }
+
+ s = gostringsize(siz);
+ siz = 0;
+ for(i=0; i<b.nel; i++) {
+ siz += runetochar(s.str+siz, a[i]);
+ }
+
+ FLUSH(&s);
+}
+
enum
{
Runeself = 0x80,