Cleanup: Use LISTBASE_FOREACH macro for node groups

This commit is contained in:
Hans Goudey
2024-12-19 15:00:31 -05:00
parent 7655784981
commit aa50f0ba07

View File

@@ -325,13 +325,8 @@ static Vector<NodeLinkItem> ui_node_link_items(NodeLinkArg *arg,
{
Vector<NodeLinkItem> items;
/* XXX this should become a callback for node types! */
if (arg->node_type->type == NODE_GROUP) {
bNodeTree *ngroup;
for (ngroup = (bNodeTree *)arg->bmain->nodetrees.first; ngroup;
ngroup = (bNodeTree *)ngroup->id.next)
{
LISTBASE_FOREACH (bNodeTree *, ngroup, &arg->bmain->nodetrees) {
const char *disabled_hint;
if ((ngroup->type != arg->ntree->type) ||
!bke::node_group_poll(arg->ntree, ngroup, &disabled_hint))
@@ -340,9 +335,7 @@ static Vector<NodeLinkItem> ui_node_link_items(NodeLinkArg *arg,
}
}
for (ngroup = (bNodeTree *)arg->bmain->nodetrees.first; ngroup;
ngroup = (bNodeTree *)ngroup->id.next)
{
LISTBASE_FOREACH (bNodeTree *, ngroup, &arg->bmain->nodetrees) {
const char *disabled_hint;
if ((ngroup->type != arg->ntree->type) ||
!bke::node_group_poll(arg->ntree, ngroup, &disabled_hint))