소스 검색

Minor cosmetic change for readability.

Jing Yang 2 년 전
부모
커밋
18699fdd34
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      raft/src/process_append_entries.rs

+ 1 - 1
raft/src/process_append_entries.rs

@@ -75,7 +75,7 @@ impl<Command: serde::Serialize> Raft<Command> {
         let mut first_mismatch = rf.log.end();
         for (i, entry) in args.entries.into_iter().enumerate() {
             let index = i + args.prev_log_index + 1;
-            if rf.log.end() > index {
+            if index < rf.log.end() {
                 if rf.log.at(index).term != entry.term {
                     check_or_record!(
                         index > rf.commit_index,