Merge pull request #10562 from johncming/naked_return

contrib/raftexample: fix naked return.
This commit is contained in:
Xiang Li 2019-03-19 21:43:26 -07:00 committed by GitHub
commit 77d4b742cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,7 +126,7 @@ func (rc *raftNode) saveSnap(snap raftpb.Snapshot) error {
func (rc *raftNode) entriesToApply(ents []raftpb.Entry) (nents []raftpb.Entry) {
if len(ents) == 0 {
return
return ents
}
firstIdx := ents[0].Index
if firstIdx > rc.appliedIndex+1 {