Эх сурвалжийг харах

Update one `log.end() - 1` call to use `log.last_index_term()`.

Jing Yang 5 жил өмнө
parent
commit
543b2d2f0e
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      src/lib.rs

+ 1 - 1
src/lib.rs

@@ -306,7 +306,7 @@ where
             rf.commit_index = if args.leader_commit < rf.log.end() {
                 args.leader_commit
             } else {
-                rf.log.end() - 1
+                rf.log.last_index_term().0
             };
             self.apply_command_signal.notify_one();
         }