Skip to content

Commit

Permalink
Remove redundant else
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Aug 10, 2022
1 parent 1156d0c commit 92f797d
Showing 1 changed file with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,45 +683,33 @@ the Domain should consist of ranges (which do not sum to the whole ValueSet), an
if (complement) {
return Optional.empty();
}
else {
return Optional.of(Domain.create(ValueSet.ofRanges(Range.equal(type, value)), false));
}
return Optional.of(Domain.create(ValueSet.ofRanges(Range.equal(type, value)), false));
case GREATER_THAN:
if (complement) {
return Optional.empty();
}
else {
return Optional.of(Domain.create(ValueSet.ofRanges(Range.greaterThan(type, value)), false));
}
return Optional.of(Domain.create(ValueSet.ofRanges(Range.greaterThan(type, value)), false));
case GREATER_THAN_OR_EQUAL:
if (complement) {
return Optional.empty();
}
else {
return Optional.of(Domain.create(ValueSet.ofRanges(Range.greaterThanOrEqual(type, value)), false));
}
return Optional.of(Domain.create(ValueSet.ofRanges(Range.greaterThanOrEqual(type, value)), false));
case LESS_THAN:
if (complement) {
return Optional.empty();
}
else {
return Optional.of(Domain.create(ValueSet.ofRanges(Range.lessThan(type, value)), false));
}
return Optional.of(Domain.create(ValueSet.ofRanges(Range.lessThan(type, value)), false));
case LESS_THAN_OR_EQUAL:
if (complement) {
return Optional.empty();
}
else {
return Optional.of(Domain.create(ValueSet.ofRanges(Range.lessThanOrEqual(type, value)), false));
}
return Optional.of(Domain.create(ValueSet.ofRanges(Range.lessThanOrEqual(type, value)), false));
case NOT_EQUAL:
case IS_DISTINCT_FROM:
if (complement) {
return Optional.of(Domain.create(ValueSet.ofRanges(Range.equal(type, value)), false));
}
else {
return Optional.empty();
}
return Optional.empty();
}
throw new AssertionError("Unhandled operator: " + comparisonOperator);
}
Expand Down

0 comments on commit 92f797d

Please sign in to comment.