[Bf-blender-cvs] [043dd64c269] master: DRW: minor optimization accessing the loop between a face and edge

Campbell Barton noreply at git.blender.org
Fri Mar 22 16:46:12 CET 2019


Commit: 043dd64c269702d21666ef0af4e7b02f6fe507b1
Author: Campbell Barton
Date:   Sat Mar 23 02:44:22 2019 +1100
Branches: master
https://developer.blender.org/rB043dd64c269702d21666ef0af4e7b02f6fe507b1

DRW: minor optimization accessing the loop between a face and edge

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

M	source/blender/draw/intern/draw_cache_impl_mesh.c

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

diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index e953ae21ed6..a50951c98d8 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -2399,15 +2399,10 @@ static void mesh_create_edit_vertex_loops(
 					if (eidx != ORIGINDEX_NONE) {
 						BMEdge *eed = BM_edge_at_index(bm, eidx);
 						mesh_render_data_edge_flag(rdata, eed, &eattr);
-						/* TODO find a more efficient way to do that. */
-						BMLoop *loop;
-						BMIter iter_loop;
 						if (efa) {
-							BM_ITER_ELEM (loop, &iter_loop, efa, BM_LOOPS_OF_FACE) {
-								if (loop->e == eed) {
-									mesh_render_data_loop_flag(rdata, loop, cd_loop_uv_offset, &eattr);
-									break;
-								}
+							BMLoop *loop = BM_face_edge_share_loop(efa, eed);
+							if (loop) {
+								mesh_render_data_loop_flag(rdata, loop, cd_loop_uv_offset, &eattr);
 							}
 						}
 					}



More information about the Bf-blender-cvs mailing list