diff options
author | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:15:01 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:27:46 +0300 |
commit | d138cbfb47e379edc1ee915a8c6ff65b01f000d6 (patch) | |
tree | f4773ecce897c32eaf75295dd5f6a8e730d471ed /source/blender/editors/mesh/meshtools.c | |
parent | b0c1184875d39abac4a65a5d20e263ea6d841009 (diff) |
Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
Diffstat (limited to 'source/blender/editors/mesh/meshtools.c')
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 519822dd65c..4a1450eaccc 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -161,7 +161,7 @@ static void join_mesh_single(Depsgraph *depsgraph, */ if (key) { /* if this mesh has any shapekeys, check first, otherwise just copy coordinates */ - for (KeyBlock *kb = key->block.first; kb; kb = kb->next) { + LISTBASE_FOREACH (KeyBlock *, kb, &key->block) { /* get pointer to where to write data for this mesh in shapekey's data array */ float(*cos)[3] = ((float(*)[3])kb->data) + *vertofs; @@ -191,7 +191,7 @@ static void join_mesh_single(Depsgraph *depsgraph, * - otherwise, copy across plain coordinates (no need to transform coordinates) */ if (key) { - for (KeyBlock *kb = key->block.first; kb; kb = kb->next) { + LISTBASE_FOREACH (KeyBlock *, kb, &key->block) { /* get pointer to where to write data for this mesh in shapekey's data array */ float(*cos)[3] = ((float(*)[3])kb->data) + *vertofs; @@ -440,7 +440,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) } /* Join this object's face maps to the base one's. */ - for (bFaceMap *fmap = ob_iter->fmaps.first; fmap; fmap = fmap->next) { + LISTBASE_FOREACH (bFaceMap *, fmap, &ob_iter->fmaps) { /* See if this group exists in the object (if it doesn't, add it to the end) */ if (BKE_object_facemap_find_name(ob, fmap->name) == NULL) { bFaceMap *fmap_new = MEM_mallocN(sizeof(bFaceMap), "join faceMap"); |