diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 15:52:32 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 17:15:00 +0300 |
commit | 7d0a0b8a6da0e1cd41a1b40971e7c803ed162963 (patch) | |
tree | 03ae0a0eab32e9d7101f78e4a2dc20f0c58af88b /source/blender/editors/armature/pose_lib.c | |
parent | f82e52ebc838b666c258090236f0323d0d4f6aee (diff) |
Cleanup: Editors/Armature, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/armature` module.
No functional changes.
Diffstat (limited to 'source/blender/editors/armature/pose_lib.c')
-rw-r--r-- | source/blender/editors/armature/pose_lib.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index aa57fb5844d..9d70f8877c6 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -141,9 +141,7 @@ static int poselib_get_free_index(bAction *act) if (low < high) { return (low + 1); } - else { - return (high + 1); - } + return (high + 1); } /* returns the active pose for a poselib */ @@ -152,9 +150,7 @@ static TimeMarker *poselib_get_active_pose(bAction *act) if ((act) && (act->active_marker)) { return BLI_findlink(&act->markers, act->active_marker - 1); } - else { - return NULL; - } + return NULL; } /* Get object that Pose Lib should be found on */ @@ -173,9 +169,7 @@ static Object *get_poselib_object(bContext *C) if (area && (area->spacetype == SPACE_PROPERTIES)) { return ED_object_context(C); } - else { - return BKE_object_pose_armature_get(CTX_data_active_object(C)); - } + return BKE_object_pose_armature_get(CTX_data_active_object(C)); } /* Poll callback for operators that require existing PoseLib data (with poses) to work */ @@ -221,12 +215,10 @@ static bAction *poselib_validate(Main *bmain, Object *ob) if (ELEM(NULL, ob, ob->pose)) { return NULL; } - else if (ob->poselib == NULL) { + if (ob->poselib == NULL) { return poselib_init_new(bmain, ob); } - else { - return ob->poselib; - } + return ob->poselib; } /* ************************************************************* */ @@ -697,12 +689,11 @@ static int poselib_rename_invoke(bContext *C, wmOperator *op, const wmEvent *eve BKE_report(op->reports, RPT_ERROR, "Invalid index for pose"); return OPERATOR_CANCELLED; } - else { - /* Use the existing name of the marker as the name, - * and use the active marker as the one to rename. */ - RNA_enum_set(op->ptr, "pose", act->active_marker - 1); - RNA_string_set(op->ptr, "name", marker->name); - } + + /* Use the existing name of the marker as the name, + * and use the active marker as the one to rename. */ + RNA_enum_set(op->ptr, "pose", act->active_marker - 1); + RNA_string_set(op->ptr, "name", marker->name); /* part to sync with other similar operators... */ return WM_operator_props_popup_confirm(C, op, event); @@ -1755,9 +1746,7 @@ static int poselib_preview_exit(bContext *C, wmOperator *op) if (ELEM(exit_state, PL_PREVIEW_CANCEL, PL_PREVIEW_ERROR)) { return OPERATOR_CANCELLED; } - else { - return OPERATOR_FINISHED; - } + return OPERATOR_FINISHED; } /* Cancel previewing operation (called when exiting Blender) */ |