diff options
author | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 |
commit | 9aad19327eb719775a874f8f18bb15958db1d471 (patch) | |
tree | c515081857e0b9ad897c6d35b0be64fe4c346688 /src/pkg/patch/textdiff.go | |
parent | 073e240233589933c43143c997247c33206bb066 (diff) | |
download | golang-9aad19327eb719775a874f8f18bb15958db1d471.tar.gz |
- replaced gofmt expression formatting algorithm with
rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)
R=rsc, r
http://go/go-review/1024041
Diffstat (limited to 'src/pkg/patch/textdiff.go')
-rw-r--r-- | src/pkg/patch/textdiff.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/patch/textdiff.go b/src/pkg/patch/textdiff.go index ddf3b2606..2bfa8815d 100644 --- a/src/pkg/patch/textdiff.go +++ b/src/pkg/patch/textdiff.go @@ -112,7 +112,7 @@ func ParseTextDiff(raw []byte) (TextDiff, os.Error) { if oldLine+delta != newLine { return nil, SyntaxError("chunk delta is out of sync with previous chunks") } - delta += nnew-nold; + delta += nnew - nold; c.Line = oldLine; var old, new bytes.Buffer; @@ -157,7 +157,7 @@ func (d TextDiff) Apply(data []byte) ([]byte, os.Error) { for _, c := range d { var ok bool; var prefix []byte; - prefix, data, ok = getLine(data, c.Line - line); + prefix, data, ok = getLine(data, c.Line-line); if !ok || !bytes.HasPrefix(data, c.Old) { return nil, ErrPatchFailure } |