runtime: fix string optimization

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6354048
This commit is contained in:
Russ Cox 2012-06-27 17:32:41 -04:00
parent 8744d35dd3
commit 71643b2fdb
1 changed files with 3 additions and 1 deletions

View File

@ -155,7 +155,9 @@ concatstring(int32 n, String *s)
out = s[i];
}
}
if(count <= 1) // zero or one non-empty string in concatenation
if(count == 0)
return runtime·emptystring;
if(count == 1) // zero or one non-empty string in concatenation
return out;
out = gostringsize(l);