otlLib.builder: don't specialcase tuple as it's immutable and returns itself
https://github.com/fonttools/fonttools/pull/793#discussion_r94358989
This commit is contained in:
parent
1d28abdb65
commit
dd0cf31d4e
@ -590,9 +590,8 @@ class ClassDefBuilder(object):
|
|||||||
|
|
||||||
def canAdd(self, glyphs):
|
def canAdd(self, glyphs):
|
||||||
if isinstance(glyphs, (set, frozenset)):
|
if isinstance(glyphs, (set, frozenset)):
|
||||||
glyphs = tuple(sorted(glyphs))
|
glyphs = sorted(glyphs)
|
||||||
elif not isinstance(glyphs, tuple):
|
glyphs = tuple(glyphs)
|
||||||
glyphs = tuple(glyphs)
|
|
||||||
if glyphs in self.classes_:
|
if glyphs in self.classes_:
|
||||||
return True
|
return True
|
||||||
for glyph in glyphs:
|
for glyph in glyphs:
|
||||||
@ -602,9 +601,8 @@ class ClassDefBuilder(object):
|
|||||||
|
|
||||||
def add(self, glyphs):
|
def add(self, glyphs):
|
||||||
if isinstance(glyphs, (set, frozenset)):
|
if isinstance(glyphs, (set, frozenset)):
|
||||||
glyphs = tuple(sorted(glyphs))
|
glyphs = sorted(glyphs)
|
||||||
elif not isinstance(glyphs, tuple):
|
glyphs = tuple(glyphs)
|
||||||
glyphs = tuple(glyphs)
|
|
||||||
if glyphs in self.classes_:
|
if glyphs in self.classes_:
|
||||||
return
|
return
|
||||||
self.classes_.add(glyphs)
|
self.classes_.add(glyphs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user