Procházet zdrojové kódy

Use unstable sort as suggested by clippy.

Jing Yang před 5 roky
rodič
revize
2a9d852196
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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