summaryrefslogtreecommitdiff
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
commitc861f30835090bbd6b9b35a80667f26952843767 (patch)
tree645bd57ef3c9326ec02e646a751b9075d12a79e7 /src/pkg/patch/textdiff.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/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 2bfa8815d..8771f22d7 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);
}