diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-10-07 01:35:57 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-10-07 01:38:33 +0300 |
commit | 439c9b0b8478336f987b532212650c59b5f9f30f (patch) | |
tree | 2ee0463a50c6f23a61066176685e11886a3f10a5 /source/blender/sequencer/intern/iterator.c | |
parent | 877ba6b251bb5af673d023b243fd6da03e4a0fab (diff) |
Cleanup: VSE iterator semantics
Use `BLI_gset_ensure_p_ex()` instead of `BLI_gset_insert()` after
checking `BLI_gset_lookup()`.
Diffstat (limited to 'source/blender/sequencer/intern/iterator.c')
-rw-r--r-- | source/blender/sequencer/intern/iterator.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/sequencer/intern/iterator.c b/source/blender/sequencer/intern/iterator.c index 2429405350b..e83d158881e 100644 --- a/source/blender/sequencer/intern/iterator.c +++ b/source/blender/sequencer/intern/iterator.c @@ -189,10 +189,12 @@ SeqCollection *SEQ_query_by_reference(Sequence *seq_reference, */ bool SEQ_collection_append_strip(Sequence *seq, SeqCollection *collection) { - if (BLI_gset_lookup(collection->set, seq) != NULL) { + void **key; + if (BLI_gset_ensure_p_ex(collection->set, seq, &key)) { return false; } - BLI_gset_insert(collection->set, seq); + + *key = (void *)seq; return true; } |