Explorar el Código

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

Jing Yang hace 5 años
padre
commit
543b2d2f0e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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();
         }