From c861f30835090bbd6b9b35a80667f26952843767 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 20 Nov 2009 11:45:05 -0800 Subject: gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R=r, gri CC=golang-dev http://codereview.appspot.com/156115 --- src/pkg/bytes/bytes.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pkg/bytes/bytes.go') diff --git a/src/pkg/bytes/bytes.go b/src/pkg/bytes/bytes.go index 171fa3d1b..8548b1549 100644 --- a/src/pkg/bytes/bytes.go +++ b/src/pkg/bytes/bytes.go @@ -61,7 +61,7 @@ func explode(s []byte, n int) [][]byte { } _, size = utf8.DecodeRune(s); a[na] = s[0:size]; - s = s[size:len(s)]; + s = s[size:]; na++; } return a[0:na]; @@ -144,7 +144,7 @@ func genSplit(s, sep []byte, sepSave, n int) [][]byte { i += len(sep) - 1; } } - a[na] = s[start:len(s)]; + a[na] = s[start:]; return a[0 : na+1]; } @@ -201,7 +201,7 @@ func HasPrefix(s, prefix []byte) bool { // HasSuffix tests whether the byte array s ends with suffix. func HasSuffix(s, suffix []byte) bool { - return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):len(s)], suffix) + return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):], suffix) } // Map returns a copy of the byte array s with all its characters modified @@ -217,7 +217,7 @@ func Map(mapping func(rune int) int, s []byte) []byte { wid := 1; rune := int(s[i]); if rune >= utf8.RuneSelf { - rune, wid = utf8.DecodeRune(s[i:len(s)]) + rune, wid = utf8.DecodeRune(s[i:]) } rune = mapping(rune); if nbytes+utf8.RuneLen(rune) > maxbytes { -- cgit v1.2.3