raft: use log.lastIndex()

This commit is contained in:
Xiang Li 2014-05-28 11:04:21 -07:00 committed by Yicheng Qin
parent 888ddacd3c
commit a06729a96a

View File

@ -30,7 +30,7 @@ func (l *log) maybeAppend(index, logTerm, commit int, ents ...Entry) bool {
func (l *log) append(after int, ents ...Entry) int {
l.ents = append(l.ents[:after+1], ents...)
return len(l.ents) - 1
return l.lastIndex()
}
func (l *log) lastIndex() int {