Use multiple-value-call/values instead of apply/list to forward keyword arguments.

Pascal J. Bourguignon [2014-10-02 21:33]
Use multiple-value-call/values instead of apply/list to forward keyword arguments.
Filename
common-lisp/cesarum/combination.lisp
diff --git a/common-lisp/cesarum/combination.lisp b/common-lisp/cesarum/combination.lisp
index 5f35da1..9b86e0f 100644
--- a/common-lisp/cesarum/combination.lisp
+++ b/common-lisp/cesarum/combination.lisp
@@ -80,9 +80,9 @@ License:
 (deftype cardinal () '(integer 0))

 (defun copy-vector (vector &key (start 0) (end (length vector))
-                    (element-type nil))
-  (let ((result (apply (function make-array) (list (- end start))
-                       (when element-type (list :element-type element-type)))))
+                    (element-type t element-type-p))
+  (let ((result (multiple-value-call (function make-array) (list (- end start))
+                  (if element-type-p (values :element-type element-type) (values)))))
     (replace result vector :start2 start :end2 end)
     result))
ViewGit