Explorar o código

Use unstable sort as suggested by clippy.

Jing Yang %!s(int64=5) %!d(string=hai) anos
pai
achega
2a9d852196
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/lib.rs

+ 1 - 1
src/lib.rs

@@ -672,7 +672,7 @@ impl Raft {
                     if rf.is_leader() && rf.current_term == term {
                         let mut matched = rf.match_index.to_vec();
                         let mid = matched.len() / 2 + 1;
-                        matched.sort();
+                        matched.sort_unstable();
                         let new_commit_index = matched[mid];
                         if new_commit_index > rf.commit_index
                             && rf.log[new_commit_index].term == rf.current_term