* 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>.
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)