1
0

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:
renovate
2020-05-09 13:44:17 +00:00
committed by konrad
parent 18f6e31b54
commit def2362682
89 changed files with 9018 additions and 4502 deletions

View File

@ -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)
}