-
- //copy left childs pGroups and remove groups that the user doesn't want
- copyLCpcount = t->tree[lc].pcount;
- for (it = copyLCpcount.begin(); it != copyLCpcount.end(); it++) {
- if (inUsersGroups(it->first, globaldata->Groups) != true) { copyLCpcount.erase(it->first); }
- }
-
- //copy right childs pGroups and remove groups that the user doesn't want
- copyRCpcount = t->tree[rc].pcount;
- for (it = copyRCpcount.begin(); it != copyRCpcount.end(); it++) {
- if (inUsersGroups(it->first, globaldata->Groups) != true) { copyRCpcount.erase(it->first); }
- }
-
- //if i's children are from the same group and i has a BL then add i's length to unique
- //if copyRCpcount.size() = 0 && copyLCpcount.size() = 0 they are from a branch that is entirely from a group the user doesn't want
- if ((copyRCpcount.size() == 0) && (copyLCpcount.size() == 0)) { }
- else {
- if ((copyRCpcount == copyLCpcount) && (t->tree[i].getBranchLength() != -1)) { UniqueBL += t->tree[i].getBranchLength(); }
- //if either childs groups = 0 then all of there groups were not valid making the parent unique
- else if (((copyRCpcount.size() == 0) || (copyLCpcount.size() == 0)) && (t->tree[i].getBranchLength() != -1)) { UniqueBL += t->tree[i].getBranchLength(); }
- }
+
+ //if i's children are from the same group then i's pcount size will be 1
+ //if copyIpcount.size() = 0 they are from a branch that is entirely from a group the user doesn't want
+ if (copyIpcount.size() == 0) { }
+ else if ((t->tree[i].getBranchLength() != -1) && (copyIpcount.size() == 1)) { UniqueBL += t->tree[i].getBranchLength(); }