Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-12-15 23:51:58 +0300
committerHans Goudey <h.goudey@me.com>2021-12-15 23:51:58 +0300
commitaa55cb2996d4f9a87493d8a0cf602724884703b8 (patch)
treeb6fcc8e716282e429654c2a841eb4889237465f9
parent43875e8dd1d76ee783b0d44e5199acfc650a07fb (diff)
Cleanup: Use const arguments, references
Also slightly change naming to avoid camel case.
-rw-r--r--source/blender/modifiers/intern/MOD_nodes.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 79838f61dfe..211257597cb 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -268,18 +268,19 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
}
}
-static bool checkForTimeNode(bNodeTree *tree, Set<bNodeTree *> &r_checked_trees)
+static bool check_tree_for_time_node(const bNodeTree &tree,
+ Set<const bNodeTree *> &r_checked_trees)
{
- if (!r_checked_trees.add(tree)) {
+ if (!r_checked_trees.add(&tree)) {
return false;
}
- LISTBASE_FOREACH (bNode *, node, &tree->nodes) {
+ LISTBASE_FOREACH (const bNode *, node, &tree.nodes) {
if (node->type == GEO_NODE_INPUT_SCENE_TIME) {
return true;
}
if (node->type == NODE_GROUP) {
- bNodeTree *subtree = (bNodeTree *)node->id;
- if (checkForTimeNode(subtree, r_checked_trees)) {
+ const bNodeTree *sub_tree = reinterpret_cast<const bNodeTree *>(node->id);
+ if (check_tree_for_time_node(*sub_tree, r_checked_trees)) {
return true;
}
}
@@ -291,13 +292,13 @@ static bool dependsOnTime(struct Scene *UNUSED(scene),
ModifierData *md,
const int UNUSED(dag_eval_mode))
{
- NodesModifierData *nmd = reinterpret_cast<NodesModifierData *>(md);
- bNodeTree *tree = nmd->node_group;
+ const NodesModifierData *nmd = reinterpret_cast<NodesModifierData *>(md);
+ const bNodeTree *tree = nmd->node_group;
if (tree == nullptr) {
return false;
}
- Set<bNodeTree *> checked_trees;
- return checkForTimeNode(tree, checked_trees);
+ Set<const bNodeTree *> checked_trees;
+ return check_tree_for_time_node(*tree, checked_trees);
}
static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *userData)