From b0307c538e2018939a9b3ab00daa2099720ab1c3 Mon Sep 17 00:00:00 2001 From: Kevin Rosenberg Date: Sun, 6 Jun 2010 11:12:03 -0600 Subject: [PATCH] Optimized list generation with nconc vs. append --- parse-common.lisp | 4 ++-- sql-classes.lisp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parse-common.lisp b/parse-common.lisp index 67a5236..ae7af53 100644 --- a/parse-common.lisp +++ b/parse-common.lisp @@ -45,8 +45,8 @@ (defun ufile-pathname (ufile &optional (extension "")) "Return pathname for a umls filename with an optional extension" (assert (typep ufile 'ufile)) - (let* ((dirs (append (list (dir ufile)) - (awhen (subdir ufile) (list it)))) + (let* ((dirs (nconc (list (dir ufile)) + (awhen (subdir ufile) (list it)))) (name-list (delimited-string-to-list (fil ufile) #\.)) (name (if (second name-list) (first name-list) diff --git a/sql-classes.lisp b/sql-classes.lisp index 8031ace..64cc4b3 100644 --- a/sql-classes.lisp +++ b/sql-classes.lisp @@ -911,8 +911,8 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS" only-exact-if-match limit &key extra-lookup-args) (let ((uobjs '())) (dolist (word (delimited-string-to-list str #\space)) - (setq uobjs (append uobjs - (kmrcl:flatten (apply obj-lookup-fun word :srl srl extra-lookup-args))))) + (setq uobjs (nconc uobjs + (kmrcl:flatten (apply obj-lookup-fun word :srl srl extra-lookup-args))))) (let ((sorted (funcall sort-fun str (delete-duplicates uobjs :test #'= :key key)))) -- 2.34.1