Skip to content

Commit 9a0ad03

Browse files
committed
Cache splitting keys.
1 parent 9a08544 commit 9a0ad03

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,10 @@ def __init__(self, *args, **kwargs):
685685
name: mapping.new_child()
686686
for name, mapping in self._namespace_maps.items()
687687
}
688-
self._mapping = ChainMap(*self._namespace_maps.values())
689688

690-
def _split_key(self, key, sep="."):
689+
@staticmethod
690+
@functools.lru_cache
691+
def _split_key(key, sep="."):
691692
keys = key.split(sep, maxsplit=1)
692693
return keys, len(keys)
693694

0 commit comments

Comments
 (0)