BMesh: remove redundant edge-split loop initialize
authorCampbell Barton <ideasman42@gmail.com>
Mon, 7 Nov 2016 20:05:29 +0000 (07:05 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 7 Nov 2016 20:13:20 +0000 (07:13 +1100)
Would always set both first1 and first2.

source/blender/bmesh/intern/bmesh_core.c

index b65307a7ab034cd41b71cab243d97de218d28d23..c75e2649257b17836cb302750706bdda57c420f3 100644 (file)
@@ -1669,7 +1669,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
 #ifndef NDEBUG
                int radlen = bmesh_radial_length(l_next);
 #endif
-               int first1 = 0, first2 = 0;
+               bool is_first = true;
 
                /* Take the next loop. Remove it from radial. Split it. Append to appropriate radials */
                while (l_next) {
@@ -1691,13 +1691,8 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
                                l->e = e_new;
 
                                /* append l into e_new's rad cycle */
-                               if (!first1) {
-                                       first1 = 1;
-                                       l->radial_next = l->radial_prev = NULL;
-                               }
-
-                               if (!first2) {
-                                       first2 = 1;
+                               if (is_first) {
+                                       is_first = false;
                                        l->radial_next = l->radial_prev = NULL;
                                }
                                
@@ -1709,13 +1704,8 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
                                l->e = e;
 
                                /* append l into e_new's rad cycle */
-                               if (!first1) {
-                                       first1 = 1;
-                                       l->radial_next = l->radial_prev = NULL;
-                               }
-
-                               if (!first2) {
-                                       first2 = 1;
+                               if (is_first) {
+                                       is_first = false;
                                        l->radial_next = l->radial_prev = NULL;
                                }