Skip to content

Commit

Permalink
fixed min max check not working if there were 0 of the min required c…
Browse files Browse the repository at this point in the history
…omponent
  • Loading branch information
Trinsdar committed Oct 25, 2023
1 parent 50e6558 commit 0a1953f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,14 @@ public boolean checkStructure() {
validStructure = structure.check((T)this);
boolean[] fail = new boolean[1];
fail[0] = false;
components.forEach((s, l) -> {
if (!structure.getMinMaxMap().containsKey(s)){
return;
structure.getMinMaxMap().forEach((s, p) -> {
int min = p.left();
int max = p.right();
int size = 0;
if (components.containsKey(s)){
size = components.get(s).size();
}
int min = structure.getMinMaxMap().get(s).left();
int max = structure.getMinMaxMap().get(s).right();
if (l.size() < min || l.size() > max){
if (size < min || size > max){
fail[0] = true;
}
});
Expand Down

0 comments on commit 0a1953f

Please sign in to comment.