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
Venelin Stoykov 2017-08-18 09:10:27 +03:00 committed by Goulu
parent 14de393d5e
commit 171cdcc69d
1 changed files with 1 additions and 1 deletions

View File

@ -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