Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save the item before updating the order of the children. Also always …
…increment the weight count (even if it is equal to the weight of the current child)
- Loading branch information
73c7ec5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The why...
It seemed to make sense to save the item so the window that changes are on the fly is smaller.
If the weights are equal, then you would never increment the weight value until the next item, so it was possible to create duplicate weights. Incrementing outside of the if allows the weight value always move forward.