Microoptimization for singlebyte fonts (#84)
Instead of list comprehension which will call a function to get the integer value of the bytes directly convert it to bytearray which is more optimal structure for storing list of bytes.pull/98/head
parent
14de393d5e
commit
171cdcc69d
|
@ -494,7 +494,7 @@ class PDFFont(object):
|
|||
return False
|
||||
|
||||
def decode(self, bytes):
|
||||
return [six.indexbytes(bytes, i) for i,_ in enumerate(bytes)] # map(ord, bytes)
|
||||
return bytearray(bytes) # map(ord, bytes)
|
||||
|
||||
def get_ascent(self):
|
||||
return self.ascent * self.vscale
|
||||
|
|
Loading…
Reference in New Issue