Skip to content

Commit

Permalink
Simplify Group::IsVisible(), GroupsInOrder().
Browse files Browse the repository at this point in the history
  • Loading branch information
Evil-Spirit authored and whitequark committed Jan 12, 2017
1 parent 43db220 commit 022d012
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,8 @@ bool SolveSpaceUI::PruneOrphans() {
bool SolveSpaceUI::GroupsInOrder(hGroup before, hGroup after) {
if(before.v == 0) return true;
if(after.v == 0) return true;

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;
int beforep = SK.GetGroup(before)->order;
int afterp = SK.GetGroup(after)->order;
if(beforep >= afterp) return false;
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion src/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void Group::AddParam(IdList<Param,hParam> *param, hParam hp, double v) {

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

Expand Down

0 comments on commit 022d012

Please sign in to comment.