Skip to content

Commit

Permalink
fixed infinite loop bug when analyzing BoundedFieldRule
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Jan 3, 2015
1 parent 7a09a15 commit a7e5d4d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ public BoundedFieldRule(T cause, Collection<T> rule, int min, int max) {
public double nCr() {
throw new UnsupportedOperationException();
}

@Override
public boolean isEmpty() {
return fields.isEmpty() && minResult >= 0;
}

@Override
@Deprecated
public SimplifyResult simplify(GroupValues<T> knownValues) {
if (this.isEmpty()) {
return SimplifyResult.NO_EFFECT;
Expand All @@ -65,6 +69,8 @@ public SimplifyResult simplify(GroupValues<T> knownValues) {
if (known != null) {
it.remove();
result -= known;
minResult -= known;
maxResult -= known;
}
else totalCount += group.size();
}
Expand Down

0 comments on commit a7e5d4d

Please sign in to comment.