summaryrefslogtreecommitdiff
path: root/src/pkg/bytes/bytes.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-11-20 11:45:05 -0800
committerRuss Cox <rsc@golang.org>2009-11-20 11:45:05 -0800
commitc861f30835090bbd6b9b35a80667f26952843767 (patch)
tree645bd57ef3c9326ec02e646a751b9075d12a79e7 /src/pkg/bytes/bytes.go
parent7089e97992d5d6be520dfea787200061992526c8 (diff)
downloadgolang-c861f30835090bbd6b9b35a80667f26952843767.tar.gz
gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
Diffstat (limited to 'src/pkg/bytes/bytes.go')
-rw-r--r--src/pkg/bytes/bytes.go8
1 files changed, 4 insertions, 4 deletions
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 {