Remove superfluous std::sort from atlas generation #64435
Merged
+3
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
rectpack2D::find_best_packingfunction does not in fact alter the input container's order.This is the only place the actual
subjectsargument is referenced in therectpack2D::find_best_packingdefinition:The library allocates its own order arrays for each comparator, and manipulates these arrays, not the input container.
Since the input
std::vector< QgsTextureRect > rectsingenerateAtlasis already generated usingindex++for every subsequent element, there seems to be no need to ever sort these elements.