AvariceLHubris пре 1 година
родитељ
комит
2a69ad1659
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/hufftree/canonical.rs

+ 2 - 2
src/hufftree/canonical.rs

@@ -16,8 +16,8 @@ struct CharTempCode {
 
 impl Ord for CharTempCode {
     fn cmp(&self, other: &Self) -> std::cmp::Ordering {
-        let ordering = self.code_length.cmp(&other.code_length);
-        ordering
+        self.code_length.cmp(&other.code_length)
+            .then(other.code.cmp(&self.code))
     }
 }