From 1982cad4909146ad74e948c3f84b39b1c8ec5b60 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Tue, 12 Mar 2024 17:31:02 +0100 Subject: [PATCH] Fix: update comparator for std::sort for NamedAttribute This PR applies a fix for the comparator being passed into std::sort to avoid potential Mac / libc++ issues as seen in #119189 Pull Request: https://projects.blender.org/blender/blender/pulls/119385 --- source/blender/editors/space_node/node_draw.cc | 2 +- source/blender/modifiers/intern/MOD_nodes.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 10b5e3c6665..f099fda2f5a 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -2527,7 +2527,7 @@ static std::string named_attribute_tooltip(bContext * /*C*/, void *argN, const c std::sort(sorted_used_attribute.begin(), sorted_used_attribute.end(), [](const NameWithUsage &a, const NameWithUsage &b) { - return BLI_strcasecmp_natural(a.name.c_str(), b.name.c_str()) <= 0; + return BLI_strcasecmp_natural(a.name.c_str(), b.name.c_str()) < 0; }); for (const NameWithUsage &attribute : sorted_used_attribute) { diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 5b9a8e97ebe..a2e24cee185 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -2236,7 +2236,7 @@ static void draw_named_attributes_panel(uiLayout *layout, NodesModifierData &nmd std::sort(sorted_used_attribute.begin(), sorted_used_attribute.end(), [](const NameWithUsage &a, const NameWithUsage &b) { - return BLI_strcasecmp_natural(a.name.c_str(), b.name.c_str()) <= 0; + return BLI_strcasecmp_natural(a.name.c_str(), b.name.c_str()) < 0; }); for (const NameWithUsage &attribute : sorted_used_attribute) {