Update module spf13/viper to v1.7.0 (#494)
Update module spf13/viper to v1.7.0 Reviewed-on: https://kolaente.dev/vikunja/api/pulls/494
This commit is contained in:
14
vendor/honnef.co/go/tools/functions/loops.go
vendored
14
vendor/honnef.co/go/tools/functions/loops.go
vendored
@ -2,9 +2,9 @@ package functions
|
||||
|
||||
import "honnef.co/go/tools/ssa"
|
||||
|
||||
type Loop map[*ssa.BasicBlock]bool
|
||||
type Loop struct{ ssa.BlockSet }
|
||||
|
||||
func findLoops(fn *ssa.Function) []Loop {
|
||||
func FindLoops(fn *ssa.Function) []Loop {
|
||||
if fn.Blocks == nil {
|
||||
return nil
|
||||
}
|
||||
@ -18,12 +18,16 @@ func findLoops(fn *ssa.Function) []Loop {
|
||||
// n is a back-edge to h
|
||||
// h is the loop header
|
||||
if n == h {
|
||||
sets = append(sets, Loop{n: true})
|
||||
set := Loop{}
|
||||
set.Add(n)
|
||||
sets = append(sets, set)
|
||||
continue
|
||||
}
|
||||
set := Loop{h: true, n: true}
|
||||
set := Loop{}
|
||||
set.Add(h)
|
||||
set.Add(n)
|
||||
for _, b := range allPredsBut(n, h, nil) {
|
||||
set[b] = true
|
||||
set.Add(b)
|
||||
}
|
||||
sets = append(sets, set)
|
||||
}
|
||||
|
Reference in New Issue
Block a user