[Bf-blender-cvs] [8074a18964f] master: Cleanup: move unchanged condition out of loop

Germano Cavalcante noreply at git.blender.org
Mon Jul 13 14:02:59 CEST 2020


Commit: 8074a18964fb62192bf053c5be977a3624cbb5a4
Author: Germano Cavalcante
Date:   Sun Jul 12 21:01:54 2020 -0300
Branches: master
https://developer.blender.org/rB8074a18964fb62192bf053c5be977a3624cbb5a4

Cleanup: move unchanged condition out of loop

===================================================================

M	source/blender/editors/transform/transform_convert_mesh.c

===================================================================

diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c
index 90e45253afa..b3232fc1d91 100644
--- a/source/blender/editors/transform/transform_convert_mesh.c
+++ b/source/blender/editors/transform/transform_convert_mesh.c
@@ -1075,23 +1075,6 @@ static void trans_mesh_customdata_correction_init_container(TransInfo *t, TransD
     return;
   }
 
-  if (!ELEM(t->mode,
-            TFM_TRANSLATION,
-            TFM_ROTATION,
-            TFM_RESIZE,
-            TFM_TOSPHERE,
-            TFM_SHEAR,
-            TFM_BEND,
-            TFM_SHRINKFATTEN,
-            TFM_TRACKBALL,
-            TFM_PUSHPULL,
-            TFM_ALIGN,
-            TFM_EDGE_SLIDE,
-            TFM_VERT_SLIDE)) {
-    /* Currently only modes that change the position of vertices are supported. */
-    return;
-  }
-
   BMEditMesh *em = BKE_editmesh_from_object(tc->obedit);
   BMesh *bm = em->bm;
 
@@ -1173,6 +1156,23 @@ static void trans_mesh_customdata_correction_init_container(TransInfo *t, TransD
 
 void trans_mesh_customdata_correction_init(TransInfo *t)
 {
+  if (!ELEM(t->mode,
+            TFM_TRANSLATION,
+            TFM_ROTATION,
+            TFM_RESIZE,
+            TFM_TOSPHERE,
+            TFM_SHEAR,
+            TFM_BEND,
+            TFM_SHRINKFATTEN,
+            TFM_TRACKBALL,
+            TFM_PUSHPULL,
+            TFM_ALIGN,
+            TFM_EDGE_SLIDE,
+            TFM_VERT_SLIDE)) {
+    /* Currently only modes that change the position of vertices are supported. */
+    return;
+  }
+
   const char uvcalc_correct_flag = ELEM(t->mode, TFM_VERT_SLIDE, TFM_EDGE_SLIDE) ?
                                        UVCALC_TRANSFORM_CORRECT_SLIDE :
                                        UVCALC_TRANSFORM_CORRECT;



More information about the Bf-blender-cvs mailing list