diff options
author | JSDurand <mmemmew@gmail.com> | 2022-11-17 12:50:07 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2022-11-17 12:50:07 +0800 |
commit | 983bf3a1725ed7eb8df6973ca1393e75d3eb68e4 (patch) | |
tree | 5612e9374568f84ba1bf39c55a548a3c638f4442 /common.el | |
parent | 7edf313d2c8892818fc64dc125b30f967bb565ce (diff) |
bongo: Add cache
* common.el (durand-take): Declare as pure and side-effect free.
* durand-bongo.el (bongo-sub-redisplay): Do nothing when not playing,
to avoid clearing the subtitles buffer when stopped.
(durand-bongo-time-process): A helper to replace nil values by 0 in
the return value of `parse-time-string'.
(bongo-sub-status-string): Use a cache to avoid searching for the
subtitle every second.
Diffstat (limited to 'common.el')
-rw-r--r-- | common.el | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -461,6 +461,7 @@ current line; negative ARG means to put the line upwards." (defun durand-take (n ls) "Return the first N items of LS. If the length of LS is less than N, then return the whole LS." + (declare (pure t) (side-effect-free t)) (cond ((< (length ls) n) ls) ((let ((i 0) result) |