aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorStefan Monnier2023-11-08 14:20:09 -0500
committerStefan Monnier2023-11-08 22:42:16 -0500
commit9c6b22bb3e2126a1ab355b81ae4268ac53c2b6fe (patch)
treebac6574c1b211ead218bb7003e5339f66adc89ce /java
parent19445b6b7bb04e44e39ef2e39a620bd3eadb0acd (diff)
downloademacs-9c6b22bb3e2126a1ab355b81ae4268ac53c2b6fe.tar.gz
emacs-9c6b22bb3e2126a1ab355b81ae4268ac53c2b6fe.zip
(derived-mode-all-parents): Speed up with a cache
Most uses of the mode hierarchy don't really need to construct the list, they just need to iterate over it. With single inheritance we could do it just by jumping up from a mode to its parent, but to support the upcoming multiple inheritance we'd need a more complex and costly iterator. Luckily, the inheritance graph is mostly static so we can cache the list of all parents, making `derived-mode-all-parents` cheap enough to be the basis of iteration and keeping the API very simple. * lisp/subr.el (derived-mode-all-parents): Cache the result. (derived-mode--flush): New function. (derived-mode-set-parent): Use it.
Diffstat (limited to 'java')
0 files changed, 0 insertions, 0 deletions