aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/patch/textdiff.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/patch/textdiff.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/patch/textdiff.go')
-rw-r--r--src/pkg/patch/textdiff.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/patch/textdiff.go b/src/pkg/patch/textdiff.go
index 2bfa8815d2..8771f22d7d 100644
--- a/src/pkg/patch/textdiff.go
+++ b/src/pkg/patch/textdiff.go
@@ -64,7 +64,7 @@ func ParseTextDiff(raw []byte) (TextDiff, os.Error) {
var dropOldNL, dropNewNL bool;
var nold, nnew int;
var lastch byte;
- chunk = chunk[1:len(chunk)];
+ chunk = chunk[1:];
for _, l := range chunk {
if nold == oldCount && nnew == newCount && (len(l) == 0 || l[0] != '\\') {
if len(bytes.TrimSpace(l)) != 0 {
@@ -122,7 +122,7 @@ func ParseTextDiff(raw []byte) (TextDiff, os.Error) {
if nold == oldCount && nnew == newCount {
break
}
- ch, l := l[0], l[1:len(l)];
+ ch, l := l[0], l[1:];
if ch == '\\' {
continue
}
@@ -162,7 +162,7 @@ func (d TextDiff) Apply(data []byte) ([]byte, os.Error) {
return nil, ErrPatchFailure
}
buf.Write(prefix);
- data = data[len(c.Old):len(data)];
+ data = data[len(c.Old):];
buf.Write(c.New);
line = c.Line + bytes.Count(c.Old, newline);
}