branch: externals/beardbolt commit 2633e20e667ea7a9f1ff25a8684049657e33167a Author: João Távora <joaotav...@gmail.com> Commit: João Távora <joaotav...@gmail.com>
* beardbolt.el (bb--reachable-p): Rework for small speed gain. --- beardbolt.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/beardbolt.el b/beardbolt.el index 154276dd52..a04b3d42ac 100644 --- a/beardbolt.el +++ b/beardbolt.el @@ -393,22 +393,22 @@ Returns a list (SPEC ...) where SPEC looks like (WHAT FN CMD)." :kill)))) (cl-defun bb--reachable-p (label globals graph synonyms weaks) - (cond ((and (not (buffer-local-value 'bb-preserve-library-functions - bb--source-buffer)) - (gethash label weaks)) - nil) - ((gethash label globals) t) - (t - (maphash (lambda (from to) - (let ((synonym (gethash label synonyms))) + (let ((synonym (gethash label synonyms))) + (cond ((and (not (buffer-local-value 'bb-preserve-library-functions + bb--source-buffer)) + (gethash label weaks)) + nil) + ((gethash label globals) t) + (t + (maphash (lambda (from to) (when (and (or (gethash label to) (and synonym (gethash synonym to))) (bb--reachable-p from globals graph synonyms weaks)) (cl-return-from bb--reachable-p (progn (when synonym (puthash synonym t globals)) - (puthash label t globals)))))) - graph)))) + (puthash label t globals))))) + graph))))) (defun bb--process-asm () (let ((globals (make-hash-table :test #'equal))