From 05d8e516ea5ec3852b7e9186f8cdc72f93867015 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Subject: [PATCH 07/39] use WHEN in FIND-WORDS instead of IF/PROGN --- src/lisp/solver.lisp | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/lisp/solver.lisp b/src/lisp/solver.lisp index 5877c28..3d821ee 100755 --- a/src/lisp/solver.lisp +++ b/src/lisp/solver.lisp @@ -82,21 +82,19 @@ (setf (aref word fi) #\Null) ;; handle Q's - (if (eql cc #\Q) - (progn - (setq cc #\U) - (setf (aref word fi) cc) - (setq fi (+ fi 1)) - (setf (fill-pointer word) fi) - (setf (aref word fi) #\Null) - (setq tr (get-child tr #\Q)) - )) + (when (eql cc #\Q) + (setq cc #\U) + (setf (aref word fi) cc) + (setq fi (+ fi 1)) + (setf (fill-pointer word) fi) + (setf (aref word fi) #\Null) + (setq tr (get-child tr #\Q))) ;; Any words in the trie ? - (if (and (>= (length word) *min-word-length*) + (when (and (>= (length word) *min-word-length*) (trie-include-prune-p tr word)) - ;; yield to the passed in func - (funcall word-func word)) + ;; yield to the passed in func + (funcall word-func word)) (setf tr (aref (trie-children tr) (- (char-code cc) (char-code #\A)))) -- 1.6.2