[GlyphCoordinates] Faster .zeros()
Using .frombytes() since bytes() constructor can make zeros fast.
This commit is contained in:
parent
7ef101ccb1
commit
acc56bdf72
@ -1461,12 +1461,8 @@ class GlyphCoordinates(object):
|
||||
@staticmethod
|
||||
def zeros(count):
|
||||
g = GlyphCoordinates()
|
||||
a = g._a
|
||||
for i in range(count):
|
||||
a.append(0)
|
||||
a.append(0)
|
||||
g._a.frombytes(bytes(count * 2 * g._a.itemsize))
|
||||
return g
|
||||
return GlyphCoordinates([(0,0)] * count)
|
||||
|
||||
def copy(self):
|
||||
c = GlyphCoordinates(typecode=self._a.typecode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user