diff --git a/lists.lisp b/lists.lisp index feaa72633607e0e43a947cd190734b0096c29d45..502eb7153bf8915f3e4d7af64e4afaeea3447a1e 100644 --- a/lists.lisp +++ b/lists.lisp @@ -279,19 +279,8 @@ not destructively modified. Keys are compared using EQ." "Just like REMOVE-FROM-PLIST, but this version may destructively modify the provided plist." (declare (optimize speed)) - (loop with head = plist - with tail = nil ; a nil tail means an empty result so far - for (key . rest) on plist by #'cddr - do (assert rest () "Expected a proper plist, got ~S" plist) - (if (member key keys :test #'eq) - ;; skip over this pair - (symbol-macrolet ((next (cdr rest))) - (if tail - (setf (cdr tail) next) - (setf head next))) - ;; keep this pair - (setf tail rest)) - finally (return head))) + (dolist (key keys plist) + (remf plist key))) (define-modify-macro remove-from-plistf (&rest keys) remove-from-plist "Modify macro for REMOVE-FROM-PLIST.")