Skip to content

Commit

Permalink
Revert "Simplify Group::IsVisible(), GroupsInOrder()."
Browse files Browse the repository at this point in the history
This reverts commit 022d012.

The commit above has caused crashes during pruning.
  • Loading branch information
whitequark committed Jan 16, 2017
1 parent 85b8439 commit 1d1bddd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@ bool SolveSpaceUI::PruneOrphans() {
bool SolveSpaceUI::GroupsInOrder(hGroup before, hGroup after) {
if(before.v == 0) return true;
if(after.v == 0) return true;
int beforep = SK.GetGroup(before)->order;
int afterp = SK.GetGroup(after)->order;

int beforep = -1, afterp = -1;
int i;
for(i = 0; i < SK.groupOrder.n; i++) {
hGroup hg = SK.groupOrder.elem[i];
if(hg.v == before.v) beforep = i;
if(hg.v == after.v) afterp = i;
}
if(beforep < 0 || afterp < 0) return false;
if(beforep >= afterp) return false;
return true;
}
Expand Down
3 changes: 1 addition & 2 deletions src/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ void Group::AddParam(IdList<Param,hParam> *param, hParam hp, double v) {

bool Group::IsVisible() {
if(!visible) return false;
Group *active = SK.GetGroup(SS.GW.activeGroup);
if(order > active->order) return false;
if(SS.GroupsInOrder(SS.GW.activeGroup, h)) return false;
return true;
}

Expand Down

0 comments on commit 1d1bddd

Please sign in to comment.