[varLib] Actually remove duplicates while optimizing VarStore!

Ouch!  Shrinks NotoSans-VF.ttf GDEF VarStore further down.
Original was 1016278 bytes. Before this change it was optimizing
to 256145 bytes. With this change, it goes down to a mere 57127
bytes!!!
This commit is contained in:
Behdad Esfahbod 2018-02-21 01:27:58 -08:00
parent e910309952
commit d46d40dc9e

View File

@ -241,13 +241,13 @@ class _Encoding(object):
self.chars = chars
self.width = self._popcount(chars)
self.overhead = self._characteristic_overhead(chars)
self.items = []
self.items = set()
def append(self, row):
self.items.append(row)
self.items.add(row)
def extend(self, lst):
self.items.extend(lst)
self.items.update(lst)
def get_room(self):
"""Maximum number of bytes that can be added to characteristic