Skip to content

Commit

Permalink
Speed up cache key construction in variableScalar (#2801)
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Sep 5, 2022
1 parent 64fd837 commit d48d858
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/fontTools/feaLib/variableScalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ def value_at_location(self, location):

@property
def model(self):
locations = [dict(self._normalized_location(k)) for k in self.values.keys()]
key = tuple([tuple(x.items()) for x in locations])
key = tuple(self.values.keys())
if key in self.model_pool:
return self.model_pool[key]
locations = [dict(self._normalized_location(k)) for k in self.values.keys()]
m = VariationModel(locations)
self.model_pool[key] = m
return m
Expand Down

0 comments on commit d48d858

Please sign in to comment.