def decompile(self, data, ttFont):
    if ((data is not None) and (ttFont is not None)):
        self.decompileHeader(data, ttFont)
    else:
        assert ((data is None) and (ttFont is None)), 'Need both data and ttFont arguments'
    data = self.data
    charCodes = []
    gids = []
    pos = 0
    for i in range(self.nGroups):
        (startCharCode, endCharCode, glyphID) = struct.unpack('>LLL', data[pos:(pos + 12)])
        pos += 12
        lenGroup = ((1 + endCharCode) - startCharCode)
        charCodes.extend(list(range(startCharCode, (endCharCode + 1))))
        gids.extend(self._computeGIDs(glyphID, lenGroup))
    self.data = data = None
    self.cmap = cmap = {}
    lenCmap = len(gids)
    glyphOrder = self.ttFont.getGlyphOrder()
    try:
        names = list(map(operator.getitem, ([glyphOrder] * lenCmap), gids))
    except IndexError:
        getGlyphName = self.ttFont.getGlyphName
        names = list(map(getGlyphName, gids))
    list(map(operator.setitem, ([cmap] * lenCmap), charCodes, names))
def decompile(self, data, ttFont):
    if ((data is not None) and (ttFont is not None)):
        self.decompileHeader(data, ttFont)
    else:
        assert ((data is None) and (ttFont is None)), 'Need both data and ttFont arguments'
    data = self.data
    charCodes = []
    gids = []
    pos = 0
    for i in range(self.nGroups):
        (startCharCode, endCharCode, glyphID) = struct.unpack('>LLL', data[pos:(pos + 12)])
        pos += 12
        lenGroup = ((1 + endCharCode) - startCharCode)
        charCodes.extend(list(range(startCharCode, (endCharCode + 1))))
        gids.extend(self._computeGIDs(glyphID, lenGroup))
    self.data = data = None
    self.cmap = cmap = {}
    lenCmap = len(gids)
    glyphOrder = self.ttFont.getGlyphOrder()
    try:
        names = list(map(operator.getitem, ([glyphOrder] * lenCmap), gids))
    except IndexError:
        getGlyphName = self.ttFont.getGlyphName
        names = list(map(getGlyphName, gids))
    list(map(operator.setitem, ([cmap] * lenCmap), charCodes, names))