Revert "Cleanup: avoid for loop"

This reverts commit 390dc94562.

After testing this is approx half the speed of a for loop.

Add missing break and assign snap_elements to a variable.
This commit is contained in:
Campbell Barton 2018-10-10 10:54:18 +11:00
parent 2a2858b30d
commit 1dd3b93d2f
Notes: blender-bot 2023-02-14 06:00:44 +01:00
Referenced by issue #57134, Crashing with extrusion tool (Blender 2.8, Windows 10)
1 changed files with 4 additions and 1 deletions

View File

@ -154,10 +154,13 @@ class VIEW3D_HT_header(Header):
snap_elements = tool_settings.snap_elements
if len(snap_elements) == 1:
text = ""
icon = snap_items[next(iter(snap_elements))].icon
for elem in snap_elements:
icon = snap_items[elem].icon
break
else:
text = "Mix"
icon = 'NONE'
del snap_items, snap_elements
row = layout.row(align=True)
row.prop(tool_settings, "use_snap", text="")