Commit 374b5048 authored by Eric Timmons's avatar Eric Timmons
Browse files

Add safe-sort function that copies the sequence before sorting

parent ffd18452
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
           #:process-stream
           #:retriable-error
           #:run-program-augment-env-args
           #:safe-sort
           #:sort-plist
           #:uri-to-string
           #:url-port
@@ -212,3 +213,7 @@ overwrites the value from ~default-ht~."
        :do (push key out)
            (push value out))
    (nreverse out)))

(defun safe-sort (sequence predicate &rest args &key key)
  (declare (ignore key))
  (apply #'sort (copy-seq sequence) predicate args))