From 88f495dd68a20c1e16043e57e072324c628a8dc9 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 15 Mar 2018 13:07:53 +0000 Subject: [PATCH] feaLib.parser: use set for predefined ssXX and cvXX tags it turns out regex would be slower in this case See comments: https://github.com/fonttools/fonttools/commit/7cefeadb3a6cae1635928ab2d8bac1467cd069cf#r28011318 --- Lib/fontTools/feaLib/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/fontTools/feaLib/parser.py b/Lib/fontTools/feaLib/parser.py index 3781a9ffb..2b2f2d478 100644 --- a/Lib/fontTools/feaLib/parser.py +++ b/Lib/fontTools/feaLib/parser.py @@ -16,8 +16,8 @@ log = logging.getLogger(__name__) class Parser(object): extensions = {} ast = ast - SS_FEATURE_TAGS = ["ss%02d" % i for i in range(1, 20+1)] - CV_FEATURE_TAGS = ["cv%02d" % i for i in range(1, 99+1)] + SS_FEATURE_TAGS = {"ss%02d" % i for i in range(1, 20+1)} + CV_FEATURE_TAGS = {"cv%02d" % i for i in range(1, 99+1)} def __init__(self, featurefile, glyphNames=(), followIncludes=True, **kwargs):