From dba6e3ec423212f5de4caf431d2e53c525f2c984 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 31 Jan 2014 13:08:13 -0800 Subject: [PATCH] Make shr-generic into a defsusbt to make the stack shallower * net/shr.el (shr-generic): Make into a defsubst to make the stack depth shallower. --- lisp/ChangeLog | 5 +++++ lisp/net/shr.el | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 90c00963ad4..9b7e338e187 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-01-31 Lars Ingebrigtsen + + * net/shr.el (shr-generic): Make into a defsubst to make the stack + depth shallower (bug#16587). + 2014-01-31 Dmitry Gutov * progmodes/ruby-mode.el (ruby-align-chained-calls): New option. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 1491512087d..dba0f71bfe1 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -359,6 +359,14 @@ size, and full-buffer size." (push (shr-transform-dom sub) result))) (nreverse result))) +(defsubst shr-generic (cont) + (dolist (sub cont) + (cond + ((eq (car sub) 'text) + (shr-insert (cdr sub))) + ((listp (cdr sub)) + (shr-descend sub))))) + (defun shr-descend (dom) (let ((function (or @@ -392,14 +400,6 @@ size, and full-buffer size." (cdr (assq 'color shr-stylesheet)) (cdr (assq 'background-color shr-stylesheet))))))) -(defun shr-generic (cont) - (dolist (sub cont) - (cond - ((eq (car sub) 'text) - (shr-insert (cdr sub))) - ((listp (cdr sub)) - (shr-descend sub))))) - (defmacro shr-char-breakable-p (char) "Return non-nil if a line can be broken before and after CHAR." `(aref fill-find-break-point-function-table ,char))