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:
authorCampbell Barton <ideasman42@gmail.com>2021-09-01 08:23:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-01 08:23:56 +0300
commit90dac47717b12f33d5dd738da12a337cfe4f2f14 (patch)
tree9f4fff2c54dd7586c7929eedd95608dbca99ba99 /source/blender/editors/armature/pose_select.c
parent838b6ec48af6fb767089784193d8525c5f5faf13 (diff)
Cleanup: remove redundant strstr calls
Rely on BLI_str_quoted_substrN to detect if the prefix exists since this function exists early there is no need to check before calling.
Diffstat (limited to 'source/blender/editors/armature/pose_select.c')
-rw-r--r--source/blender/editors/armature/pose_select.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index 1dbb859fd6c..4db8569a7d2 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -1106,20 +1106,18 @@ static bool pose_select_same_keyingset(bContext *C, ReportList *reports, bool ex
for (ksp = ks->paths.first; ksp; ksp = ksp->next) {
/* only items related to this object will be relevant */
if ((ksp->id == &ob->id) && (ksp->rna_path != NULL)) {
- if (strstr(ksp->rna_path, "bones")) {
- char *boneName = BLI_str_quoted_substrN(ksp->rna_path, "bones[");
-
- if (boneName) {
- bPoseChannel *pchan = BKE_pose_channel_find_name(pose, boneName);
- MEM_freeN(boneName);
-
- if (pchan) {
- /* select if bone is visible and can be affected */
- if (PBONE_SELECTABLE(arm, pchan->bone)) {
- pchan->bone->flag |= BONE_SELECTED;
- changed = true;
- }
- }
+ char *boneName = BLI_str_quoted_substrN(ksp->rna_path, "bones[");
+ if (boneName == NULL) {
+ continue;
+ }
+ bPoseChannel *pchan = BKE_pose_channel_find_name(pose, boneName);
+ MEM_freeN(boneName);
+
+ if (pchan) {
+ /* select if bone is visible and can be affected */
+ if (PBONE_SELECTABLE(arm, pchan->bone)) {
+ pchan->bone->flag |= BONE_SELECTED;
+ changed = true;
}
}
}