Skip to content

Commit

Permalink
increase readability (?) of cut
Browse files Browse the repository at this point in the history
at least, I hope, it increases it...
  • Loading branch information
zebalu committed Dec 19, 2023
1 parent c0b5be0 commit e2dcb8c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ private void fillBeforeAfter(PartRanges ranges, List<IntRange> before, List<IntR
after.add(r);
}
}

} else {
before.add(cuted.getFirst());
after.add(cuted.getLast());
Expand Down Expand Up @@ -247,11 +246,11 @@ List<IntRange> cut(int at, char operator) {
if(operator == '<') {
return List.of(this);
} else {
return List.of(new IntRange(min, min), new IntRange(at+1, max));
return List.of(new IntRange(min, min), new IntRange(min+1, max));
}
} else {
if(operator == '<') {
return List.of(new IntRange(min, at-1), new IntRange(max, max));
return List.of(new IntRange(min, max-1), new IntRange(max, max));
} else {
return List.of(this);
}
Expand Down

0 comments on commit e2dcb8c

Please sign in to comment.