Skip to content

Commit 0f25c75

Browse files
committed
Modest performance improvement.
1 parent ecca9c3 commit 0f25c75

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -963,19 +963,17 @@ class TempCache(object):
963963
"""
964964
# A list of rcparam names that, when changed, invalidated this
965965
# cache.
966-
invalidating_rcparams = [
966+
invalidating_rcparams = (
967967
'font.serif', 'font.sans-serif', 'font.cursive', 'font.fantasy',
968-
'font.monospace']
968+
'font.monospace')
969969

970970
def __init__(self):
971971
self._lookup_cache = {}
972972
self._last_rcParams = self.make_rcparams_key()
973973

974974
def make_rcparams_key(self):
975-
key = [id(fontManager)]
976-
for param in self.invalidating_rcparams:
977-
key.append(rcParams[param])
978-
return key
975+
return [id(fontManager)] + [
976+
rcParams[param] for param in self.invalidating_rcparams]
979977

980978
def get(self, prop):
981979
key = self.make_rcparams_key()

0 commit comments

Comments
 (0)