From: Russ Cox Date: Wed, 27 Jun 2012 21:32:41 +0000 (-0400) Subject: runtime: fix string optimization X-Git-Tag: go1.1rc2~2864 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=71643b2fdbc600fea6498ed20a17ec14bb13a841;p=gostls13.git runtime: fix string optimization R=golang-dev, r CC=golang-dev https://golang.org/cl/6354048 --- diff --git a/src/pkg/runtime/string.goc b/src/pkg/runtime/string.goc index 8a5d59b81d..7cab6d2417 100644 --- a/src/pkg/runtime/string.goc +++ b/src/pkg/runtime/string.goc @@ -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);