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:
authorDalai Felinto <dfelinto@gmail.com>2017-11-07 19:06:55 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-11-07 19:08:34 +0300
commit1b18e158025a488e1ba2446ad93c2eb563c11611 (patch)
tree9fa432d1bd7e622cb0d7cd4a9160bdff7d30c554 /source/blender/depsgraph/intern/depsgraph_query.cc
parentfc789803cabc9dfd47319a7f0297456c8f60153c (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.cc6
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)