From e99d7c4d627c1f9b4b26e3890fb3b39f74234d79 Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Fri, 12 Aug 2022 13:35:01 +0200 Subject: Simplify code using take, ntake and butlast * lisp/calc/calc-vec.el (calcFunc-rhead): * lisp/calc/calc.el (calc-top-list, calc-pop): * lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): Simplify. --- lisp/emacs-lisp/ert.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/ert.el') diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index c8ff6b68144..047b0069bb9 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1813,8 +1813,7 @@ Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\ (unless (or (null tests) (zerop high)) (message "\nLONG-RUNNING TESTS") (message "------------------") - (setq tests (sort tests (lambda (x y) (> (car x) (car y))))) - (when (< high (length tests)) (setcdr (nthcdr (1- high) tests) nil)) + (setq tests (ntake high (sort tests (lambda (x y) (> (car x) (car y)))))) (message "%s" (mapconcat #'cdr tests "\n"))) ;; More details on hydra and emba, where the logs are harder to get to. (when (and (or (getenv "EMACS_HYDRA_CI") (getenv "EMACS_EMBA_CI")) -- cgit v1.2.3