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 '{}'",
geospan.material.name, dspan.key.name, indent=1)
idx = dspan.addSourceSpan(geospan)
if dspan not in _diindices:
_diindices[dspan] = [idx,]
else:
_diindices[dspan].append(idx)
diidx = _diindices.setdefault(dspan, [])
diidx.append(idx)
# Step 3.1: Harvest Span indices and create the DIIndices
drawables = []

Loading…
Cancel
Save