Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

Commit

Permalink
Reorder cases alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Simonov committed Dec 26, 2021
1 parent 740c8ac commit 40f774e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/analyzer/occurrences.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,6 @@ func (nom namedOccurrenceMap) addFromCondition(stmt *ast.IfStmt) {
nom.addFromIdent(stmt.If, e.X)
}
}
case *ast.UnaryExpr:
switch e := v.X.(type) {
case *ast.Ident:
nom.addFromIdent(stmt.If, e)
case *ast.SelectorExpr:
nom.addFromIdent(stmt.If, e.X)
}
case *ast.Ident:
nom.addFromIdent(stmt.If, v)
case *ast.CallExpr:
for _, a := range v.Args {
switch e := a.(type) {
Expand All @@ -213,6 +204,15 @@ func (nom namedOccurrenceMap) addFromCondition(stmt *ast.IfStmt) {
nom.addFromCallExpr(stmt.If, e)
}
}
case *ast.Ident:
nom.addFromIdent(stmt.If, v)
case *ast.UnaryExpr:
switch e := v.X.(type) {
case *ast.Ident:
nom.addFromIdent(stmt.If, e)
case *ast.SelectorExpr:
nom.addFromIdent(stmt.If, e.X)
}
}
}

Expand Down

0 comments on commit 40f774e

Please sign in to comment.