[varLib.interpolatable] Another micro-optimization
Don't know why the previous code was written that way!
This commit is contained in:
parent
b3a45f9f79
commit
c306836488
@ -245,9 +245,7 @@ def test(glyphsets, glyphs=None, names=None, ignore_missing=False):
|
|||||||
for i in range(n):
|
for i in range(n):
|
||||||
b = ((bits << i) & mask) | ((bits >> (n - i)))
|
b = ((bits << i) & mask) | ((bits >> (n - i)))
|
||||||
if b == bits:
|
if b == bits:
|
||||||
isomorphisms.append(
|
isomorphisms.append(_rot_list(complexPoints, i))
|
||||||
_rot_list(complexPoints, i)
|
|
||||||
)
|
|
||||||
# Add mirrored rotations
|
# Add mirrored rotations
|
||||||
mirrored = list(reversed(points.value))
|
mirrored = list(reversed(points.value))
|
||||||
reversed_bits = 0
|
reversed_bits = 0
|
||||||
@ -257,9 +255,7 @@ def test(glyphsets, glyphs=None, names=None, ignore_missing=False):
|
|||||||
for i in range(n):
|
for i in range(n):
|
||||||
b = ((reversed_bits << i) & mask) | ((reversed_bits >> (n - i)))
|
b = ((reversed_bits << i) & mask) | ((reversed_bits >> (n - i)))
|
||||||
if b == bits:
|
if b == bits:
|
||||||
isomorphisms.append(
|
isomorphisms.append(_rot_list(complexPoints, i))
|
||||||
_rot_list(complexPoints, i)
|
|
||||||
)
|
|
||||||
|
|
||||||
# m0idx should be the index of the first non-None item in allNodeTypes,
|
# m0idx should be the index of the first non-None item in allNodeTypes,
|
||||||
# else give it the last item.
|
# else give it the last item.
|
||||||
@ -368,10 +364,7 @@ def test(glyphsets, glyphs=None, names=None, ignore_missing=False):
|
|||||||
continue
|
continue
|
||||||
for ix, (contour0, contour1) in enumerate(zip(m0, m1)):
|
for ix, (contour0, contour1) in enumerate(zip(m0, m1)):
|
||||||
c0 = contour0[0]
|
c0 = contour0[0]
|
||||||
costs = [
|
costs = [_vdiff_hypot2_complex(c0, c1) for c1 in contour1]
|
||||||
v
|
|
||||||
for v in (_vdiff_hypot2_complex(c0, c1) for c1 in contour1)
|
|
||||||
]
|
|
||||||
min_cost = min(costs)
|
min_cost = min(costs)
|
||||||
first_cost = costs[0]
|
first_cost = costs[0]
|
||||||
if min_cost < first_cost * 0.95:
|
if min_cost < first_cost * 0.95:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user