Skip to content

Commit

Permalink
Correct item sorting during translation
Browse files Browse the repository at this point in the history
  • Loading branch information
rinon committed Jul 3, 2019
1 parent b1b5c3b commit 5d3b0aa
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions c2rust-transpile/src/c_ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,7 @@ impl TypedAstContext {
pub fn compare_src_locs(&self, a: &SrcLoc, b: &SrcLoc) -> Ordering {
/// Compare `self` with `other`, without regard to file id
fn cmp_pos(a: &SrcLoc, b: &SrcLoc) -> Ordering {
if a.line == b.line && a.column == b.column {
Ordering::Equal
} else if a.line < b.line
|| b.line > a.line
|| a.column < b.column
{
Ordering::Less
} else {
Ordering::Greater
}
(a.line, a.column).cmp(&(b.line, b.column))
}
let path_a = self.include_map[self.file_map[a.fileid as usize]].clone();
let path_b = self.include_map[self.file_map[b.fileid as usize]].clone();
Expand Down

0 comments on commit 5d3b0aa

Please sign in to comment.