소스 검색

Fixed ordering bug.

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))
     }
 }