Skip to content

Commit

Permalink
Add EqualFromBool helper wrapper (#48801)
Browse files Browse the repository at this point in the history
  • Loading branch information
smallinsky authored Nov 13, 2024
1 parent be971b1 commit 8b9f2b4
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 8b9f2b4

Please sign in to comment.