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:
authorCampbell Barton <ideasman42@gmail.com>2012-04-06 15:50:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-06 15:50:16 +0400
commit11a4dab32bcc7402180809525656fd3df56adb24 (patch)
treef8d4dec35b7220c0c534e6b40b408c91789f6a31 /source/blender/bmesh/operators/bmo_utils.c
parent186f018e6ee81edef14255c9fd9b6d7b5480449b (diff)
bmesh minor change - avoid increasing array sizes one by one and use iterator macros.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_utils.c')
-rw-r--r--source/blender/bmesh/operators/bmo_utils.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c
index 47c9f9ce005..c359d530f73 100644
--- a/source/blender/bmesh/operators/bmo_utils.c
+++ b/source/blender/bmesh/operators/bmo_utils.c
@@ -1083,17 +1083,16 @@ void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op)
BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) {
if (CustomData_has_layer(&(bm->ldata), CD_MLOOPUV)) {
BMLoop *lf; /* current face loops */
- int i = 0;
+ int i;
BLI_array_empty(uvs);
- BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) {
+ BLI_array_growitems(uvs, fs->len);
+
+ BM_ITER_INDEX(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs, i) {
MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV);
/* current loop uv is the previous loop uv */
- BLI_array_growone(uvs);
- uvs[i][0] = luv->uv[0];
- uvs[i][1] = luv->uv[1];
- i++;
+ copy_v2_v2(uvs[i], luv->uv);
}
/* now that we have the uvs in the array, reverse! */