In the MinimizeGroupCost method, there is a loop on v, and inside that a loop on fr. Looks like fr indicates in part how many items have been processed and removed from the gid_track list. It's very confusing and uncommented code. It looks like elements are being removed from "gid_track" and added to "track". The problem is that there is a "gid_track[0].pop_back()" to remove the last item. But right after that, a check is made against the last element at (tSize - 1 - fr). But, this element position was just removed. What exactly is the intent of this loop on "fr" inside a loop on "v" ?
It looks like you fixed this in a previous issue, but brought it back more recently in an optimization check-in. Was this a mistake?
In the MinimizeGroupCost method, there is a loop on v, and inside that a loop on fr. Looks like fr indicates in part how many items have been processed and removed from the gid_track list. It's very confusing and uncommented code. It looks like elements are being removed from "gid_track" and added to "track". The problem is that there is a "gid_track[0].pop_back()" to remove the last item. But right after that, a check is made against the last element at (tSize - 1 - fr). But, this element position was just removed. What exactly is the intent of this loop on "fr" inside a loop on "v" ?
It looks like you fixed this in a previous issue, but brought it back more recently in an optimization check-in. Was this a mistake?