mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Revert use of seq-count in shr-count
* lisp/net/shr.el (shr-count): Prefer handwritten code to using 'seq-count', as it's more performant. Problem reported by Mattias Engdegård <mattiase@acm.org>.
This commit is contained in:
parent
2cefcb2f79
commit
82cc1f4fda
1 changed files with 7 additions and 4 deletions
|
|
@ -2617,10 +2617,13 @@ flags that control whether to collect or render objects."
|
|||
columns))
|
||||
|
||||
(defun shr-count (dom elem)
|
||||
(seq-count (lambda (sub)
|
||||
(and (not (stringp sub))
|
||||
(eq (dom-tag sub) elem)))
|
||||
(dom-children dom)))
|
||||
;; This is faster than `seq-count', and shr can use it.
|
||||
(let ((i 0))
|
||||
(dolist (sub (dom-children dom))
|
||||
(when (and (not (stringp sub))
|
||||
(eq (dom-tag sub) elem))
|
||||
(setq i (1+ i))))
|
||||
i))
|
||||
|
||||
(defun shr-max-columns (dom)
|
||||
(let ((max 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue