master: digit-char: prefer a conditional move.

stassats via Sbcl-commits <[email protected]> Sun, 03 May 2026 16:34:30 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  206672bf256701de06ad574787186bec9ddcc1d3 (commit)
      from  cd730df2e1438675477515e5a31f46e480039a4d (commit)

- Log -----------------------------------------------------------------
commit 206672bf256701de06ad574787186bec9ddcc1d3
Author: Stas Boukarev <[email protected]>
Date:   Sun May 3 19:24:26 2026 +0300

    digit-char: prefer a conditional move.
---
 src/code/target-char.lisp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp
index fa764d9f9..cbe7532ff 100644
--- a/src/code/target-char.lisp
+++ b/src/code/target-char.lisp
@@ -540,7 +540,7 @@ that digit stands, else returns NIL."
                  (let ((weight (logior #x20 code))) ;; downcase ASCII characters.
                    (when (and (>= (decf weight (- (char-code #\a) 10)) 10)
                               (< weight radix))
-                     weight) ))))
+                     weight)))))
         (let ((number (ucd-decimal-digit char)))
           (when (and number (< number radix))
             number)))))
@@ -552,7 +552,7 @@ character exists."
   (declare (explicit-check weight))
   (cond ((typep weight '(and unsigned-byte fixnum))
          (and (< weight radix)
-              (code-char (if (< weight 10) (+ 48 weight) (+ 55 weight)))))
+              (code-char (+ weight (if (< weight 10) 48 55)))))
         (t
          (the unsigned-byte weight)
          nil)))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL