Skip to content

Commit

Permalink
Be more robust about iteration over clones
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Oct 6, 2023
1 parent 90c60f8 commit a1bbd81
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions attr-processors.lisp
Expand Up @@ -67,10 +67,12 @@ See PROCESS-ATTRIBUTE."
(target node))
(flet ((process (item)
(with-clipboard-bound (item)
(let ((clone (plump:clone-node target T)))
(loop for node across (plump:children clone)
do (process-node node))
(array-utils:vector-append new-children (plump:children clone))))))
(let* ((clone (plump:clone-node target T))
(children (plump:children clone)))
(loop for i from 0
while (< i (length children))
do (process-node (aref children i)))
(array-utils:vector-append new-children children)))))
(etypecase val
(list (loop for item in val do (process item)))
(vector (loop for item across val do (process item)))))
Expand Down

0 comments on commit a1bbd81

Please sign in to comment.