Replace (setf (alist-get ...)) with the faster (setcdr (assq ...))

This commit is contained in:
Gerard Vermeulen 2023-02-26 18:47:24 +01:00
parent 9e4b79f0fd
commit 888466e7d1

View File

@ -5022,7 +5022,7 @@ Available versions: 0.2.0, 0.1.1, 0.1.0
(json-parse-buffer :array-type 'list :object-type 'alist))
(let ((alists pip-outdated-packages))
(while alists
(setf (alist-get 'name (car alists))
(setcdr (assq 'name (car alists))
(string-replace "_" "-" (alist-get 'name (car alists))))
(setq alists (cdr alists))))
(kill-buffer)
@ -5147,7 +5147,7 @@ buffer to check whether upgrading has made the dependencies incompatible."
(cl-pushnew rv (alist-get 'required_version old) :test #'equal))
(let* ((new (assq-delete-all 'dependencies (copy-alist parent)))
(rvs (split-string (alist-get 'required_version new) "[,]+")))
(setf (alist-get 'required_version new) rvs)
(setcdr (assq 'required_version new) rvs)
(push new found))))
found)