1
0
Fork 0

Use built-in max

master
Philip O'Toole 7 months ago committed by GitHub
parent 8f87455f09
commit 049944377c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -642,10 +642,7 @@ func (s *Store) Committed(timeout time.Duration) (uint64, error) {
if err != nil {
return lci, err
}
if lci == 0 {
lci = 1
}
return lci, s.WaitForCommitIndex(lci, timeout)
return lci, s.WaitForCommitIndex(max(1, lci), timeout)
}
// Close closes the store. If wait is true, waits for a graceful shutdown.

Loading…
Cancel
Save