diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-07 19:06:55 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-07 19:08:34 +0300 |
commit | 1b18e158025a488e1ba2446ad93c2eb563c11611 (patch) | |
tree | 9fa432d1bd7e622cb0d7cd4a9160bdff7d30c554 /source/blender/depsgraph/intern/depsgraph_query.cc | |
parent | fc789803cabc9dfd47319a7f0297456c8f60153c (diff) |
Sanitize use of BLI_iterator
We now initialize iter.valid as true as part of the main iterator (and manually
when using via Python). And we don't even bother setting iter->current to NULL
if it's invalid. Let's stick to using iter->valid only.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_query.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index 84c8c873860..e950aa58112 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -259,7 +259,6 @@ void DEG_objects_iterator_begin(BLI_Iterator *iter, DEGObjectsIteratorData *data Depsgraph *graph = data->graph; iter->data = data; - iter->valid = true; DEG_evaluation_context_init(&data->eval_ctx, DAG_EVAL_RENDER); @@ -275,7 +274,7 @@ void DEG_objects_iterator_begin(BLI_Iterator *iter, DEGObjectsIteratorData *data DEG::IDDepsNode *id_node = (DEG::IDDepsNode *) BLI_ghashIterator_getValue(&data->gh_iter); deg_objects_iterator_step(iter, id_node); - if (iter->valid && iter->skip) { + if (iter->skip) { DEG_objects_iterator_next(iter); } } @@ -299,7 +298,6 @@ void DEG_objects_iterator_next(BLI_Iterator *iter) BLI_ghashIterator_step(&data->gh_iter); if (BLI_ghashIterator_done(&data->gh_iter)) { - iter->current = NULL; iter->valid = false; return; } @@ -307,7 +305,7 @@ void DEG_objects_iterator_next(BLI_Iterator *iter) DEG::IDDepsNode *id_node = (DEG::IDDepsNode *) BLI_ghashIterator_getValue(&data->gh_iter); deg_objects_iterator_step(iter, id_node); - } while (iter->valid && iter->skip); + } while (iter->skip); } void DEG_objects_iterator_end(BLI_Iterator *iter) |