diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:38:42 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 14:38:06 +0300 |
commit | 94eaaf097c3af408cdf84bb38aa295d01a84a741 (patch) | |
tree | 2ce58b897207e81924ef2d00e1a86d8d36b95cac /source/blender/depsgraph/intern/builder | |
parent | f453ee7d3ab4be78f7bd0be5aa14d2a281552629 (diff) |
Cleanup: Depsgraph, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/depsgraph` module.
No functional changes.
Diffstat (limited to 'source/blender/depsgraph/intern/builder')
3 files changed, 30 insertions, 31 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 5ae71dd1792..6d76829fa1d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -254,9 +254,8 @@ TimeSourceNode *DepsgraphRelationBuilder::get_node(const TimeSourceKey &key) con /* XXX TODO */ return nullptr; } - else { - return graph_->time_source; - } + + return graph_->time_source; } ComponentNode *DepsgraphRelationBuilder::get_node(const ComponentKey &key) const @@ -353,16 +352,16 @@ Relation *DepsgraphRelationBuilder::add_time_relation(TimeSourceNode *timesrc, if (timesrc && node_to) { return graph_->add_new_relation(timesrc, node_to, description, flags); } - else { - DEG_DEBUG_PRINTF((::Depsgraph *)graph_, - BUILD, - "add_time_relation(%p = %s, %p = %s, %s) Failed\n", - timesrc, - (timesrc) ? timesrc->identifier().c_str() : "<None>", - node_to, - (node_to) ? node_to->identifier().c_str() : "<None>", - description); - } + + DEG_DEBUG_PRINTF((::Depsgraph *)graph_, + BUILD, + "add_time_relation(%p = %s, %p = %s, %s) Failed\n", + timesrc, + (timesrc) ? timesrc->identifier().c_str() : "<None>", + node_to, + (node_to) ? node_to->identifier().c_str() : "<None>", + description); + return nullptr; } @@ -374,16 +373,16 @@ Relation *DepsgraphRelationBuilder::add_operation_relation(OperationNode *node_f if (node_from && node_to) { return graph_->add_new_relation(node_from, node_to, description, flags); } - else { - DEG_DEBUG_PRINTF((::Depsgraph *)graph_, - BUILD, - "add_operation_relation(%p = %s, %p = %s, %s) Failed\n", - node_from, - (node_from) ? node_from->identifier().c_str() : "<None>", - node_to, - (node_to) ? node_to->identifier().c_str() : "<None>", - description); - } + + DEG_DEBUG_PRINTF((::Depsgraph *)graph_, + BUILD, + "add_operation_relation(%p = %s, %p = %s, %s) Failed\n", + node_from, + (node_from) ? node_from->identifier().c_str() : "<None>", + node_to, + (node_to) ? node_to->identifier().c_str() : "<None>", + description); + return nullptr; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index e3b667427a2..ec18b429c2e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -190,7 +190,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, reinterpret_cast<const PropertyRNA *>(prop)); return node_identifier; } - else if (ptr->type == &RNA_PoseBone) { + if (ptr->type == &RNA_PoseBone) { const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr->data); /* Bone - generally, we just want the bone component. */ node_identifier.type = NodeType::BONE; @@ -222,7 +222,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } return node_identifier; } - else if (ptr->type == &RNA_Bone) { + if (ptr->type == &RNA_Bone) { /* Armature-level bone mapped to Armature Eval, and thus Pose Init. * Drivers have special code elsewhere that links them to the pose * bone components, instead of using this generic code. */ @@ -236,7 +236,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } return node_identifier; } - else if (RNA_struct_is_a(ptr->type, &RNA_Constraint)) { + if (RNA_struct_is_a(ptr->type, &RNA_Constraint)) { const Object *object = reinterpret_cast<const Object *>(ptr->owner_id); const bConstraint *constraint = static_cast<const bConstraint *>(ptr->data); RNANodeQueryIDData *id_data = ensure_id_data(&object->id); @@ -256,7 +256,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } return node_identifier; } - else if (ELEM(ptr->type, &RNA_ConstraintTarget, &RNA_ConstraintTargetBone)) { + if (ELEM(ptr->type, &RNA_ConstraintTarget, &RNA_ConstraintTargetBone)) { Object *object = reinterpret_cast<Object *>(ptr->owner_id); bConstraintTarget *tgt = (bConstraintTarget *)ptr->data; /* Check whether is object or bone constraint. */ @@ -315,17 +315,17 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, node_identifier.type = NodeType::TRANSFORM; return node_identifier; } - else if (contains(prop_identifier, "data")) { + if (contains(prop_identifier, "data")) { /* We access object.data, most likely a geometry. * Might be a bone tho. */ node_identifier.type = NodeType::GEOMETRY; return node_identifier; } - else if (STREQ(prop_identifier, "hide_viewport") || STREQ(prop_identifier, "hide_render")) { + if (STREQ(prop_identifier, "hide_viewport") || STREQ(prop_identifier, "hide_render")) { node_identifier.type = NodeType::OBJECT_FROM_LAYER; return node_identifier; } - else if (STREQ(prop_identifier, "dimensions")) { + if (STREQ(prop_identifier, "dimensions")) { node_identifier.type = NodeType::PARAMETERS; node_identifier.operation_code = OperationCode::DIMENSIONS; return node_identifier; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc index bd6a364e08a..c5e020b3242 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc @@ -96,7 +96,7 @@ void deg_graph_transitive_reduction(Depsgraph *graph) * need modifying. */ continue; } - else if (rel->from->custom_flags & OP_REACHABLE) { + if (rel->from->custom_flags & OP_REACHABLE) { relations_to_remove.append(rel); } } |