cplay-ng

simple curses audio player
git clone https://git.ce9e.org/cplay-ng.git

commit
5f8414edd61f22ada144c074dcec18510007aa4e
parent
0e43a4cf052dca747d0113f348fcb925d33b4326
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-09-05 16:38
perf: cache Filelist.format_item

Diffstat

M cplay.py 2 ++

1 files changed, 2 insertions, 0 deletions


diff --git a/cplay.py b/cplay.py

@@ -345,6 +345,7 @@ class Filelist(List):
  345   345             title += 'search "%s"/' % self.rsearch_str
  346   346         return title
  347   347 
   -1   348     @functools.lru_cache()
  348   349     def format_item(self, item):
  349   350         s = super().format_item(item)
  350   351         ext = get_ext(item)
@@ -357,6 +358,7 @@ class Filelist(List):
  357   358             self.path = path
  358   359             os.chdir(path)
  359   360             relpath.cache_clear()
   -1   361             self.format_item.cache_clear()
  360   362             self.search_cache = []
  361   363         self.all_items = []
  362   364         self.rsearch_str = ''