mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Use enumerate to iterate over self._types
This is more pythonic. The comparaison in the if block below the for loop now becomes clearer.
This commit is contained in:
parent
3c9d38ebd4
commit
9ac7eb4da7
1 changed files with 4 additions and 4 deletions
|
|
@ -39,10 +39,10 @@ class LayerPolygon:
|
|||
|
||||
self._extruder = extruder
|
||||
self._types = line_types
|
||||
for i in range(len(self._types)):
|
||||
if self._types[i] >= self.__number_of_types: # Got faulty line data from the engine.
|
||||
Logger.log("w", "Found an unknown line type: %s", i)
|
||||
self._types[i] = self.NoneType
|
||||
for idx, line_type in enumerate(self._types):
|
||||
if line_type >= self.__number_of_types: # Got faulty line data from the engine.
|
||||
Logger.log("w", "Found an unknown line type: %s", line_type)
|
||||
self._types[idx] = self.NoneType
|
||||
self._data = data
|
||||
self._line_widths = line_widths
|
||||
self._line_thicknesses = line_thicknesses
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue