branch: elpa/git-commit commit fef45b274ecb4dc0448bd34dac26f7eaff621e59 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-insert-child-count: Minor performance tweak --- lisp/magit-section.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/magit-section.el b/lisp/magit-section.el index e831de41df..ee8f893ac3 100644 --- a/lisp/magit-section.el +++ b/lisp/magit-section.el @@ -1626,12 +1626,11 @@ with \" (N)\", where N is the number of child sections. This function is called by `magit-insert-section' after that has evaluated its BODY. Admittedly that's a bit of a hack." - ;; This has to be fast, not pretty! (let (content count) (when (and magit-section-show-child-count + (setq content (oref section content)) (setq count (length (oref section children))) (> count 0) - (setq content (oref section content)) (eq (char-before (1- content)) ?:)) (save-excursion (goto-char (- content 2))