mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-16 00:56:23 +00:00
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:
parent
af145e8ea5
commit
dffe069985
1 changed files with 1 additions and 1 deletions
|
@ -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())));
|
||||
|
|
Loading…
Reference in a new issue