Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08192cd

Browse files
committed
Cache splitting keys.
1 parent 9b1e977 commit 08192cd

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
@@ -674,9 +674,10 @@ def __init__(self, *args, **kwargs):
674674
name: mapping.new_child()
675675
for name, mapping in self._namespace_maps.items()
676676
}
677-
self._mapping = ChainMap(*self._namespace_maps.values())
678677

679-
def _split_key(self, key, sep="."):
678+
@staticmethod
679+
@functools.lru_cache
680+
def _split_key(key, sep="."):
680681
keys = key.split(sep, maxsplit=1)
681682
return keys, len(keys)
682683

0 commit comments

Comments
 (0)