raft: remove old pointer

release-2.0
Blake Mizerany 2014-08-23 16:18:13 -07:00 committed by Yicheng Qin
parent ea66d94273
commit 1d40440830
1 changed files with 3 additions and 4 deletions

View File

@ -17,7 +17,7 @@ func Example_Node() {
// stuff to n happens in other goroutines
// the last known state
var prev *State
var prev State
for {
// ReadState blocks until there is new state ready.
st, ents, cents, msgs, err := n.ReadState(context.Background())
@ -25,14 +25,13 @@ func Example_Node() {
log.Fatal(err)
}
curr := &st
if !prev.Equal(st) {
saveStateToDisk(st)
prev = curr
prev = st
}
saveToDisk(ents)
applyToStore(cents)
go applyToStore(cents)
sendMessages(msgs)
}
}