1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-16 17:19:41 +00:00

* lisp/vc/pcvs-util.el (cvs-partition): Simplify.

This commit is contained in:
Stefan Kangas 2022-08-09 22:09:20 +02:00
parent caabc5a4ab
commit 8caa91b2ce

View File

@ -38,6 +38,7 @@
(apply #'append (mapcar (lambda (x) (if (listp x) x (list x))) xs)))
(defun cvs-first (l &optional n)
;; FIXME: Replace this with `seq-take'?
(if (null n) (car l)
(when l
(let* ((nl (list (pop l)))
@ -53,10 +54,9 @@
The function returns a `cons' cell where the `car' contains
elements of L for which P is true while the `cdr' contains
the other elements. The ordering among elements is maintained."
(let (car cdr)
(dolist (x l)
(if (funcall p x) (push x car) (push x cdr)))
(cons (nreverse car) (nreverse cdr))))
(let ((res (seq-group-by p l)))
(cons (cdr (assq t res))
(cdr (assq nil res)))))
;;;
;;; frame, window, buffer handling