diff options
author | Robert Griesemer <gri@golang.org> | 2009-11-06 14:24:38 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-11-06 14:24:38 -0800 |
commit | 828334dd95ce8e4bf3662bd5c89d7c417f0741d0 (patch) | |
tree | fd7e0c9961bc3af2ddf105e9cc1943f2509ac584 /src/pkg/go/scanner/errors.go | |
parent | eb5cdfd67ff6d32df4c4c27840eaee027c5e3512 (diff) | |
download | golang-828334dd95ce8e4bf3662bd5c89d7c417f0741d0.tar.gz |
- fine-tuning of one-line func heuristic (nodes.go)
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)
R=r, rsc
CC=go-dev
http://go/go-review/1026006
Diffstat (limited to 'src/pkg/go/scanner/errors.go')
-rw-r--r-- | src/pkg/go/scanner/errors.go | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/pkg/go/scanner/errors.go b/src/pkg/go/scanner/errors.go index 090066701..a8219b190 100644 --- a/src/pkg/go/scanner/errors.go +++ b/src/pkg/go/scanner/errors.go @@ -39,9 +39,7 @@ type ErrorVector struct { // Init initializes an ErrorVector. -func (h *ErrorVector) Init() { - h.errors.Init(0); -} +func (h *ErrorVector) Init() { h.errors.Init(0) } // NewErrorVector creates a new ErrorVector. @@ -53,9 +51,7 @@ func NewErrorVector() *ErrorVector { // ErrorCount returns the number of errors collected. -func (h *ErrorVector) ErrorCount() int { - return h.errors.Len(); -} +func (h *ErrorVector) ErrorCount() int { return h.errors.Len() } // Within ErrorVector, an error is represented by an Error node. The @@ -83,12 +79,8 @@ type ErrorList []*Error // ErrorList implements the sort Interface. -func (p ErrorList) Len() int { - return len(p); -} -func (p ErrorList) Swap(i, j int) { - p[i], p[j] = p[j], p[i]; -} +func (p ErrorList) Len() int { return len(p) } +func (p ErrorList) Swap(i, j int) { p[i], p[j] = p[j], p[i] } func (p ErrorList) Less(i, j int) bool { |