From f96712ee78c1ba81d5eb77567880390d4f74563d Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 22 Apr 2017 00:17:19 -0700 Subject: [PATCH] Move NFC marking from canonical-composition to string->nfc. --- src/runtime/ustring.scm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm index 6e364812a..4acf9bff8 100644 --- a/src/runtime/ustring.scm +++ b/src/runtime/ustring.scm @@ -893,13 +893,16 @@ USA. (ustring-in-nfc! result) result)) (else - (canonical-composition - (if (string-in-nfd? string) - string - (canonical-decomposition&ordering string - (lambda (string* n max-cp) - (declare (ignore n max-cp)) - string*))))))) + (let ((result + (canonical-composition + (if (string-in-nfd? string) + string + (canonical-decomposition&ordering string + (lambda (string* n max-cp) + (declare (ignore n max-cp)) + string*)))))) + (ustring-in-nfc! result) + result)))) (define (string->nfc-cf string) (string->nfc (string-foldcase string))) @@ -1051,9 +1054,7 @@ USA. (else (string-ref (vector-ref sv fc-index) m))))))))) (scan-for-first-char 0) - (let ((result (builder))) - (ustring-in-nfc! result) - result))) + (builder))) (define-integrable jamo-leading-start #x1100) (define-integrable jamo-leading-end #x1113) -- 2.25.1