mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: use log.lastIndex()
This commit is contained in:
parent
888ddacd3c
commit
a06729a96a
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user