diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 15:36:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 15:39:08 +0300 |
commit | ccdacf1c9b31b15e188aa9e9adb044ffd0ca0da4 (patch) | |
tree | 086fc08c0a7d7ecefb4ed6666a3c2fd813142c8b /source/blender/depsgraph | |
parent | 4da6c496137042d4c90292f5567a6702a3df3323 (diff) |
Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
(hint this isn't a simple getter).
See P611 to apply instead of manually resolving conflicts.
Diffstat (limited to 'source/blender/depsgraph')
5 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc index b76cd9eaadd..7b93434710b 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -355,7 +355,7 @@ static void deg_debug_graphviz_node(const DebugContext &ctx, case DEG_NODE_TYPE_ID_REF: { const IDDepsNode *id_node = (const IDDepsNode *)node; - if (BLI_ghash_size(id_node->components) == 0) { + if (BLI_ghash_len(id_node->components) == 0) { deg_debug_graphviz_node_single(ctx, node); } else { @@ -406,7 +406,7 @@ static bool deg_debug_graphviz_is_cluster(const DepsNode *node) case DEG_NODE_TYPE_ID_REF: { const IDDepsNode *id_node = (const IDDepsNode *)node; - return BLI_ghash_size(id_node->components) > 0; + return BLI_ghash_len(id_node->components) > 0; } case DEG_NODE_TYPE_PARAMETERS: case DEG_NODE_TYPE_ANIMATION: diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index 0448dbe2c8d..a6bdcdca19d 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -155,5 +155,5 @@ void DEG_evaluate_on_framechange(EvaluationContext *eval_ctx, bool DEG_needs_eval(Depsgraph *graph) { DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph); - return BLI_gset_size(deg_graph->entry_tags) != 0; + return BLI_gset_len(deg_graph->entry_tags) != 0; } diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index c29a0708cef..8ee66eddad6 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -253,7 +253,7 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx, const unsigned int layers) { /* Nothing to update, early out. */ - if (BLI_gset_size(graph->entry_tags) == 0) { + if (BLI_gset_len(graph->entry_tags) == 0) { return; } DEG_DEBUG_PRINTF("%s: layers:%u, graph->layers:%u\n", diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index daf008ddb7d..4033e1325e6 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -264,7 +264,7 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) BLI_assert(bmain != NULL); BLI_assert(graph != NULL); /* Nothing to update, early out. */ - if (BLI_gset_size(graph->entry_tags) == 0) { + if (BLI_gset_len(graph->entry_tags) == 0) { return; } /* Reset all flags, get ready for the flush. */ diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc index 9450ed7f17d..8ebf7424c42 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc @@ -305,7 +305,7 @@ OperationDepsNode *ComponentDepsNode::get_entry_operation() if (entry_operation) { return entry_operation; } - else if (operations_map != NULL && BLI_ghash_size(operations_map) == 1) { + else if (operations_map != NULL && BLI_ghash_len(operations_map) == 1) { OperationDepsNode *op_node = NULL; /* TODO(sergey): This is somewhat slow. */ GHASH_FOREACH_BEGIN(OperationDepsNode *, tmp, operations_map) @@ -328,7 +328,7 @@ OperationDepsNode *ComponentDepsNode::get_exit_operation() if (exit_operation) { return exit_operation; } - else if (operations_map != NULL && BLI_ghash_size(operations_map) == 1) { + else if (operations_map != NULL && BLI_ghash_len(operations_map) == 1) { OperationDepsNode *op_node = NULL; /* TODO(sergey): This is somewhat slow. */ GHASH_FOREACH_BEGIN(OperationDepsNode *, tmp, operations_map) @@ -348,7 +348,7 @@ OperationDepsNode *ComponentDepsNode::get_exit_operation() void ComponentDepsNode::finalize_build() { - operations.reserve(BLI_ghash_size(operations_map)); + operations.reserve(BLI_ghash_len(operations_map)); GHASH_FOREACH_BEGIN(OperationDepsNode *, op_node, operations_map) { operations.push_back(op_node); |