[varLib.interpolatable] Speed up _rot_list()

This commit is contained in:
Behdad Esfahbod 2023-10-20 16:03:40 -06:00
parent cb2f4c1a61
commit 77dea10e5f

View File

@ -20,11 +20,7 @@ import sys
def _rot_list(l, k):
"""Rotate list by k items forward. Ie. item at position 0 will be
at position k in returned list. Negative k is allowed."""
n = len(l)
k %= n
if not k:
return l
return l[n - k :] + l[: n - k]
return l[-k :] + l[: -k]
class PerContourPen(BasePen):