conflicts: remove redundant check of num_sides from condition

Since `Merge` always has one more "adds" than "removes", there's no
need to check both of them. I really should have noticed this in
0b3b62a777.
This commit is contained in:
Martin von Zweigbergk 2023-08-13 12:16:09 -07:00 committed by Martin von Zweigbergk
parent af145e8ea5
commit dffe069985

View file

@ -205,7 +205,7 @@ pub fn parse_conflict(input: &[u8], num_sides: usize) -> Option<Vec<Merge<Conten
} else if conflict_start.is_some() && line == CONFLICT_END_LINE {
let conflict_body = &input[conflict_start.unwrap() + CONFLICT_START_LINE.len()..pos];
let hunk = parse_conflict_hunk(conflict_body);
if hunk.removes().len() + 1 == num_sides && hunk.adds().len() == num_sides {
if hunk.adds().len() == num_sides {
let resolved_slice = &input[resolved_start..conflict_start.unwrap()];
if !resolved_slice.is_empty() {
hunks.push(Merge::resolved(ContentHunk(resolved_slice.to_vec())));