Raymond Toy pushed to branch master at cmucl / cmucl Commits: f1c6efeb by Raymond Toy at 2026-06-26T18:29:40-07:00 Fix #317: String comparisons done with code-units - - - - - 38111614 by Raymond Toy at 2026-06-26T18:29:40-07:00 Merge branch 'issue-317-string-compare-by-code-unit' into 'master' Fix #317: String comparisons done with code-units Closes #317 See merge request cmucl/cmucl!383 - - - - - 1 changed file: - src/code/string.lisp Changes: ===================================== src/code/string.lisp ===================================== @@ -280,37 +280,11 @@ ,(if lessp `nil `(- (the fixnum index) ,offset1))) - #-unicode ((,(if lessp 'char< 'char>) (schar string1 index) (schar string2 (+ (the fixnum index) (- start2 start1)))) (- (the fixnum index) ,offset1)) - #-unicode - (t nil) - #+unicode - (t - ;; Compare in code point order. See - ;; http://icu-project.org/docs/papers/utf16_code_point_order.html - (flet ((fixup (code) - (if (>= code #xe000) - (- code #x800) - (+ code #x2000)))) - (declare (inline fixup)) - (let* ((c1 (char-code (schar string1 index))) - (c2 (char-code (schar string2 - (+ (the fixnum index) - (- start2 start1)))))) - (cond ((and (>= c1 #xd800) - (>= c2 #xd800)) - (let ((fix-c1 (fixup c1)) - (fix-c2 (fixup c2))) - (if (,(if lessp '< '>) fix-c1 fix-c2) - (- (the fixnum index) ,offset1) - nil))) - (t - (if (,(if lessp '< '>) c1 c2) - (- (the fixnum index) ,offset1) - nil))))))) + (t nil)) ,(if equalp `(- (the fixnum end1) ,offset1) 'nil)))))) ) ; eval-when View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/9b6135db7475bbf23557e5b... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/9b6135db7475bbf23557e5b... You're receiving this email because of your account on gitlab.common-lisp.net. Manage all notifications: https://gitlab.common-lisp.net/-/profile/notifications | Help: https://gitlab.common-lisp.net/help
participants (1)
-
Raymond Toy (@rtoy)