]> Cypherpunks repositories - gostls13.git/commitdiff
an early 6g limitation forced the use of
authorRuss Cox <rsc@golang.org>
Tue, 7 Apr 2009 04:14:38 +0000 (21:14 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 7 Apr 2009 04:14:38 +0000 (21:14 -0700)
string(b)[0:n]
instead of the more direct string(b[0:n]).
convert to the more direct form.

R=r
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=27082
CL=27140

src/lib/bufio_test.go
src/lib/fmt/format.go
src/lib/syscall/errstr_darwin.go
src/lib/syscall/errstr_linux.go

index 4afad83404c9e0503430553a79be57dc601deab2..ef97bc46ec4bcbfe0483d4d41ce6cc52387c6a46 100644 (file)
@@ -135,7 +135,7 @@ func readBytes(buf *BufRead) string {
                nb++;
        }
        // BUG return string(b[0:nb]) ?
-       return string(b)[0:nb]
+       return string(b[0:nb])
 }
 
 // Call Read to accumulate the text of a file
index 14c5043ac7af8f006d44c5a2d8ef7c333a8a7d2d..ce5050371f9f503683d831ad7b887bb649f785f2 100644 (file)
@@ -222,7 +222,7 @@ func (f *Fmt) integer(a int64, base uint, is_signed bool, digits *string) string
                buf[i] = ' ';
                i--;
        }
-       return string(buf)[i+1:nByte];
+       return string(buf[i+1:nByte]);
 }
 
 // Fmt_d64 formats an int64 in decimal.
index 1ea3576019b2287d56ad41ae4edc574bd5e1230d..abb79b88429df26bd3a47b334cdbb118278560e5 100644 (file)
@@ -231,7 +231,7 @@ func str(val int64) string {  // do it here rather than with fmt to avoid depend
                val /= 10;
        }
        buf[i] = byte(val + '0');
-       return string(buf)[i:len(buf)];
+       return string(buf[i:len(buf)]);
 }
 
 func Errstr(errno int64) string {
index 61ac4b56e1bc7ba49d2150ab50f1a3d42bf2e0ee..47b5c6462fd1631e678533a3852552ca0a6152f4 100644 (file)
@@ -281,7 +281,7 @@ func str(val int64) string {  // do it here rather than with fmt to avoid depend
                val /= 10;
        }
        buf[i] = byte(val + '0');
-       return string(buf)[i:len(buf)];
+       return string(buf[i:len(buf)]);
 }
 
 func Errstr(errno int64) string {