mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00:00
chore: Use slices package where possible (#6585)
* chore: Use slices package where possible * More, mostly using ContainsFunc * Even more slice operations
This commit is contained in:
parent
9dda8fbf84
commit
2faeac0a10
21 changed files with 142 additions and 268 deletions
|
|
@ -16,6 +16,7 @@ package caddyfile
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
)
|
||||
|
||||
type adjacency map[string][]string
|
||||
|
|
@ -91,12 +92,7 @@ func (i *importGraph) areConnected(from, to string) bool {
|
|||
if !ok {
|
||||
return false
|
||||
}
|
||||
for _, v := range al {
|
||||
if v == to {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(al, to)
|
||||
}
|
||||
|
||||
func (i *importGraph) willCycle(from, to string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue