diff --git a/node/node.go b/node/node.go index 65b65ad96fe..f43ae11ad22 100644 --- a/node/node.go +++ b/node/node.go @@ -25,6 +25,7 @@ import ( "fmt" "path/filepath" "reflect" + "slices" "strings" "sync" "time" @@ -203,12 +204,7 @@ func (n *Node) doClose(errs []error) error { // containsLifecycle checks if 'lfs' contains 'l'. func containsLifecycle(lfs []Lifecycle, l Lifecycle) bool { - for _, obj := range lfs { - if obj == l { - return true - } - } - return false + return slices.Contains(lfs, l) } // stopServices terminates running services, RPC and p2p networking.