Skip to content

Commit

Permalink
improved isEmpty functionality of a UniqueSequence
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Jan 4, 2015
1 parent 577efca commit 648e146
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,7 @@ public UniqueSequence(T cause, List<List<T>> fields) {

@Override
public boolean isEmpty(GroupValues<T> knownValues) {
for (List<T> i : list) {
for (T t : i) {
Integer value = getSetValue(t, knownValues);
if (value == null) {
return false;
}
}
}
return true;
return list.isEmpty();
}

@Override
Expand All @@ -50,6 +42,16 @@ public SimplifyResult simplify(GroupValues<T> knownValues) {
}
}

for (List<T> i : list) {
for (T t : i) {
Integer value = getSetValue(t, knownValues);
if (value == null) {
return SimplifyResult.NO_EFFECT;
}
}
}

list.clear();
return SimplifyResult.NO_EFFECT;
}

Expand Down

0 comments on commit 648e146

Please sign in to comment.