Skip to content

Commit

Permalink
Add EqualFromBool helper wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
smallinsky authored and github-actions committed Nov 12, 2024
1 parent 65f44dd commit c53ab7d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/services/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,3 +434,12 @@ func NodeHasMissedKeepAlives(s types.Server) bool {
serverExpiry := s.Expiry()
return serverExpiry.Before(time.Now().Add(apidefaults.ServerAnnounceTTL - (apidefaults.ServerKeepAliveTTL() * 2)))
}

// EqualFromBool is a helper function that converts a boolean value to an integer
// value that represents the equality status.
func EqualFromBool(b bool) int {
if !b {
return Different
}
return Equal
}

0 comments on commit c53ab7d

Please sign in to comment.