Skip to content

Commit

Permalink
refactor: using slices.Contains to simplify the code (#13315)
Browse files Browse the repository at this point in the history
Signed-off-by: luchenhan <[email protected]>
  • Loading branch information
luchenhan authored Jan 10, 2025
1 parent ea136cb commit 334e628
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"fmt"
"path/filepath"
"reflect"
"slices"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 334e628

Please sign in to comment.