[varLib.interpolatable] Speed up _rot_list()
This commit is contained in:
parent
cb2f4c1a61
commit
77dea10e5f
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user