Permalink
Browse files

gofmt cleanup

  • Loading branch information...
1 parent aee69d8 commit 99eda839283ec6dd2f299134eed70d7df31a7bd4 @axw committed Mar 24, 2012
Showing with 5 additions and 7 deletions.
  1. +0 −1 llgo/llgo.go
  2. +3 −2 methods.go
  3. +2 −4 stmt.go
View
@@ -144,4 +144,3 @@ func main() {
}
// vim: set ft=go :
-
View
@@ -61,11 +61,12 @@ func (c *compiler) fixMethodDecls(file *ast.File) {
methods := name.Methods
methodname := funcdecl.Name.String()
i := sort.Search(len(methods), func(i int) bool {
- return methods[i].Name >= methodname})
+ return methods[i].Name >= methodname
+ })
if i < len(methods) && methods[i].Name == methodname {
panic("Duplicate method")
} else if i <= 0 {
- name.Methods = append(types.ObjList{method_obj},methods...)
+ name.Methods = append(types.ObjList{method_obj}, methods...)
} else if i >= len(methods) {
name.Methods = append(methods, method_obj)
} else {
View
@@ -170,16 +170,14 @@ func (c *compiler) VisitIfStmt(stmt *ast.IfStmt) {
c.builder.SetInsertPointAtEnd(if_block)
c.VisitBlockStmt(stmt.Body)
- if in := if_block.LastInstruction();
- in.IsNil() || in.IsATerminatorInst().IsNil() {
+ if in := if_block.LastInstruction(); in.IsNil() || in.IsATerminatorInst().IsNil() {
c.builder.CreateBr(resume_block)
}
if stmt.Else != nil {
c.builder.SetInsertPointAtEnd(else_block)
c.VisitStmt(stmt.Else)
- if in := else_block.LastInstruction();
- in.IsNil() || in.IsATerminatorInst().IsNil() {
+ if in := else_block.LastInstruction(); in.IsNil() || in.IsATerminatorInst().IsNil() {
c.builder.CreateBr(resume_block)
}
}

0 comments on commit 99eda83

Please sign in to comment.