diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-18 10:45:14 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-18 10:53:45 +0300 |
commit | df8a9648e2e349f9c673bf112285770cec6cb197 (patch) | |
tree | 297d846e21bbdb2432ce814ce7b19393257a652c /source/blender/makesrna | |
parent | c536791f36b7b175a188b615ffcc5e366b833da4 (diff) |
Cleanup: remove redundant sequencer name checks
The `seq->name + 2` check dates back to 2009 [0] but does nothing.
[0]: 6e0c1cd4e5acaa91adbfd2137709a6803647cde7
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 51f62b62c8e..3f371188578 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -528,7 +528,7 @@ static char *rna_SequenceTransform_path(PointerRNA *ptr) Editing *ed = SEQ_editing_get(scene); Sequence *seq = sequence_get_by_transform(ed, ptr->data); - if (seq && seq->name + 2) { + if (seq) { char name_esc[(sizeof(seq->name) - 2) * 2]; BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc)); @@ -580,7 +580,7 @@ static char *rna_SequenceCrop_path(PointerRNA *ptr) Editing *ed = SEQ_editing_get(scene); Sequence *seq = sequence_get_by_crop(ed, ptr->data); - if (seq && seq->name + 2) { + if (seq) { char name_esc[(sizeof(seq->name) - 2) * 2]; BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc)); @@ -725,15 +725,10 @@ static char *rna_Sequence_path(PointerRNA *ptr) /* sequencer data comes from scene... * TODO: would be nice to make SequenceEditor data a data-block of its own (for shorter paths) */ - if (seq->name + 2) { - char name_esc[(sizeof(seq->name) - 2) * 2]; + char name_esc[(sizeof(seq->name) - 2) * 2]; - BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc)); - return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", name_esc); - } - else { - return BLI_strdup(""); - } + BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc)); + return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", name_esc); } static IDProperty **rna_Sequence_idprops(PointerRNA *ptr) @@ -1064,7 +1059,7 @@ static char *rna_SequenceColorBalance_path(PointerRNA *ptr) Editing *ed = SEQ_editing_get(scene); Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd); - if (seq && seq->name + 2) { + if (seq) { char name_esc[(sizeof(seq->name) - 2) * 2]; BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc)); @@ -1208,7 +1203,7 @@ static char *rna_SequenceModifier_path(PointerRNA *ptr) SequenceModifierData *smd = ptr->data; Sequence *seq = sequence_get_by_modifier(ed, smd); - if (seq && seq->name + 2) { + if (seq) { char name_esc[(sizeof(seq->name) - 2) * 2]; char name_esc_smd[sizeof(smd->name) * 2]; |