From 099f4f10ea6ecc27984d910a565d1e817ae77b00 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 8 Dec 2014 15:28:48 -0800 Subject: [PATCH] raft: one line --- raft/raft.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/raft/raft.go b/raft/raft.go index 7ad504def..f54d9f4b4 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -56,9 +56,7 @@ func (st StateType) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf("%q", st.String())), nil } -type progress struct { - match, next uint64 -} +type progress struct{ match, next uint64 } func (pr *progress) update(n uint64) { if pr.match < n { @@ -69,9 +67,7 @@ func (pr *progress) update(n uint64) { } } -func (pr *progress) optimisticUpdate(n uint64) { - pr.next = n + 1 -} +func (pr *progress) optimisticUpdate(n uint64) { pr.next = n + 1 } // 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.