Explorar o código

Fixed ordering bug.

AvariceLHubris hai 1 ano
pai
achega
2a69ad1659
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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))
     }
 }