go/ast: minor cleanup

It's better to use IsValid() then checking a (possibly
partially set up) position against NoPos directly.

R=dsymonds
CC=golang-dev
https://golang.org/cl/6855099
This commit is contained in:
Robert Griesemer 2012-11-26 17:17:49 -08:00
parent 178c8578d5
commit bb7c3c6803
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ func SortImports(fset *token.FileSet, f *File) {
break
}
if d.Lparen == token.NoPos {
if !d.Lparen.IsValid() {
// Not a block: sorted by default.
continue
}