mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-15 08:53:16 +00:00
diff: sort word occurrences only by positions
Since uncommon_shared_words are unique, their occurrence positions should also be unique.
This commit is contained in:
parent
5842267c73
commit
1b469321e2
1 changed files with 2 additions and 2 deletions
|
@ -256,8 +256,8 @@ fn unchanged_ranges_lcs(
|
|||
right_positions.push((right_pos, uncommon_shared_word, occurrence));
|
||||
}
|
||||
}
|
||||
left_positions.sort();
|
||||
right_positions.sort();
|
||||
left_positions.sort_unstable_by_key(|(pos, _word, _occurence)| *pos);
|
||||
right_positions.sort_unstable_by_key(|(pos, _word, _occurence)| *pos);
|
||||
let mut left_position_map = HashMap::new();
|
||||
for (i, (_pos, word, occurrence)) in left_positions.iter().enumerate() {
|
||||
left_position_map.insert((*word, *occurrence), i);
|
||||
|
|
Loading…
Reference in a new issue