Fix T93285: Wrong instance order when instancing a collection

At least on the Mac, `std::sort` sometimes passes the same value in the
`a` and `b` parameters.

The `true` return is only for cases where `a` is less than `b`.
This commit is contained in:
Germano Cavalcante 2022-04-27 11:18:23 -03:00
parent ce115a2786
commit f3d5114c41
Notes: blender-bot 2023-02-14 05:50:03 +01:00
Referenced by issue #93285, Geometry nodes: Wrong instance order when instancing a collection with more than 30 objects
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ static void node_geo_exec(GeoNodeExecParams params)
std::sort(entries.begin(),
entries.end(),
[](const InstanceListEntry &a, const InstanceListEntry &b) {
return BLI_strcasecmp_natural(a.name, b.name) <= 0;
return BLI_strcasecmp_natural(a.name, b.name) < 0;
});
for (const InstanceListEntry &entry : entries) {
instances.add_instance(entry.handle, entry.transform);