فهرست منبع

Merge pull request #10562 from johncming/naked_return

contrib/raftexample: fix naked return.
Xiang Li 6 سال پیش
والد
کامیت
77d4b742cd
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      contrib/raftexample/raft.go

+ 1 - 1
contrib/raftexample/raft.go

@@ -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 {