diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2022-08-12 13:35:01 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2022-08-14 15:43:12 +0200 |
commit | e99d7c4d627c1f9b4b26e3890fb3b39f74234d79 (patch) | |
tree | 023ef524db8ae62d413186d21a3f358c84998c15 /lisp/emacs-lisp/ert.el | |
parent | 7ece1c4840efa5be7843ebd8b24d0a4c658ebadf (diff) | |
download | emacs-e99d7c4d627c1f9b4b26e3890fb3b39f74234d79.tar.gz emacs-e99d7c4d627c1f9b4b26e3890fb3b39f74234d79.tar.bz2 emacs-e99d7c4d627c1f9b4b26e3890fb3b39f74234d79.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp/ert.el')
-rw-r--r-- | lisp/emacs-lisp/ert.el | 3 |
1 files changed, 1 insertions, 2 deletions
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")) |