Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordigitalfrost <gerald.hofmaier@gmail.com>2022-08-05 11:37:02 +0300
committerdigitalfrost <gerald.hofmaier@gmail.com>2022-08-05 11:37:02 +0300
commit9ac7eb4da7d2859f430792b4dca7fa24caa63e2f (patch)
tree54d4139c867e3dd0b60b6503291fd02caf700b83 /cura/LayerPolygon.py
parent3c9d38ebd4266cc195288cb5a13268444a5918ce (diff)
Use enumerate to iterate over self._types
This is more pythonic. The comparaison in the if block below the for loop now becomes clearer.
Diffstat (limited to 'cura/LayerPolygon.py')
-rw-r--r--cura/LayerPolygon.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py
index 2c3b432b1d..c13bef85de 100644
--- a/cura/LayerPolygon.py
+++ b/cura/LayerPolygon.py
@@ -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