[iup] Micro-optimize

This commit is contained in:
Behdad Esfahbod 2023-04-22 15:07:03 -06:00
parent afd4695d26
commit 623f3f14be

View File

@ -196,13 +196,9 @@ def can_iup_in_between(
provided error tolerance."""
assert j - i >= 2
interp = list(
iup_segment(coords[i + 1 : j], coords[i], deltas[i], coords[j], deltas[j])
)
interp = iup_segment(coords[i + 1 : j], coords[i], deltas[i], coords[j], deltas[j])
deltas = deltas[i + 1 : j]
assert len(deltas) == len(interp)
return all(
abs(complex(x - p, y - q)) <= tolerance
for (x, y), (p, q) in zip(deltas, interp)