aboutsummaryrefslogtreecommitdiff
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
commit9ac4449cb2bf8fa1fc414a9cbc67c5a46af8ea51 (patch)
tree41ba750b1ae6464558f8f8bb4871c5233f35924b /src/pkg/bytes/bytes.go
parentaa4c638b7baf1f3a0e0fd3ab10bd7c8de74869b9 (diff)
downloadgo-9ac4449cb2bf8fa1fc414a9cbc67c5a46af8ea51.tar.xz
gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
R=r, gri CC=golang-dev https://golang.org/cl/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 171fa3d1bc..8548b15490 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 {