From a9e41dd216a37031e6616442be991454874e9bb8 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Thu, 16 May 2024 01:12:35 -0400 Subject: [PATCH] Remove iteration clause from LOOP body code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While here, simplify the loops — the compiler should be able to determine appropriate types based on the loop bounds. Also reindent. --- src/schubfach.lisp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/schubfach.lisp b/src/schubfach.lisp index fabce43..8eaf22e 100644 --- a/src/schubfach.lisp +++ b/src/schubfach.lisp @@ -92,21 +92,15 @@ 576460752303423478))) (defparameter *%digits* (let ((ds (make-array 100 :element-type '(unsigned-byte 16))) - (i 0) - (j 0)) - (declare (type (integer 0) i j)) - (loop :while (< j 10) - :for k :of-type (integer 0) := 0 - :do (loop :while (< k 10) - :do (setf (aref ds i) - (logior (ash (+ k (char-code #\0)) 8) - (ash (+ j (char-code #\0)) 0))) - (incf i) - (incf k)) - - - (incf j)) - ds)) + (i 0)) + (declare (type (integer 0) i)) + (loop :for j :below 10 + :do (loop :for k :below 10 + :do (setf (aref ds i) + (logior (ash (+ k (char-code #\0)) 8) + (ash (+ j (char-code #\0)) 0))) + (incf i))) + ds)) (defparameter *%gs* (let* ((gs (make-array 1234 :element-type '(signed-byte 64))) (i 0)