raft: one line
parent
8ead428e76
commit
099f4f10ea
|
@ -56,9 +56,7 @@ func (st StateType) MarshalJSON() ([]byte, error) {
|
||||||
return []byte(fmt.Sprintf("%q", st.String())), nil
|
return []byte(fmt.Sprintf("%q", st.String())), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type progress struct {
|
type progress struct{ match, next uint64 }
|
||||||
match, next uint64
|
|
||||||
}
|
|
||||||
|
|
||||||
func (pr *progress) update(n uint64) {
|
func (pr *progress) update(n uint64) {
|
||||||
if pr.match < n {
|
if pr.match < n {
|
||||||
|
@ -69,9 +67,7 @@ func (pr *progress) update(n uint64) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pr *progress) optimisticUpdate(n uint64) {
|
func (pr *progress) optimisticUpdate(n uint64) { pr.next = n + 1 }
|
||||||
pr.next = n + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
// maybeDecrTo returns false if the given to index comes from an out of order message.
|
// maybeDecrTo returns false if the given to index comes from an out of order message.
|
||||||
// Otherwise it decreases the progress next index and returns true.
|
// Otherwise it decreases the progress next index and returns true.
|
||||||
|
|
Loading…
Reference in New Issue