Browse Source

Prefer dict `setdefault` vs membership tests

pull/121/head
Adam Johnson 6 years ago
parent
commit
eb622e5318
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 6
      korman/exporter/mesh.py

6
korman/exporter/mesh.py

@ -492,10 +492,8 @@ class MeshConverter(_MeshManager):
self._report.msg("Exported hsGMaterial '{}' geometry into '{}'", self._report.msg("Exported hsGMaterial '{}' geometry into '{}'",
geospan.material.name, dspan.key.name, indent=1) geospan.material.name, dspan.key.name, indent=1)
idx = dspan.addSourceSpan(geospan) idx = dspan.addSourceSpan(geospan)
if dspan not in _diindices: diidx = _diindices.setdefault(dspan, [])
_diindices[dspan] = [idx,] diidx.append(idx)
else:
_diindices[dspan].append(idx)
# Step 3.1: Harvest Span indices and create the DIIndices # Step 3.1: Harvest Span indices and create the DIIndices
drawables = [] drawables = []

Loading…
Cancel
Save