Move NFC marking from canonical-composition to string->nfc.
authorChris Hanson <org/chris-hanson/cph>
Sat, 22 Apr 2017 07:17:19 +0000 (00:17 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sat, 22 Apr 2017 07:17:19 +0000 (00:17 -0700)
src/runtime/ustring.scm

index 6e364812aae4013484ebea8706f2be60196909a8..4acf9bff8b9bcab7f4c559a5130c157c09e8231d 100644 (file)
@@ -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)))
 \f
 (define-integrable jamo-leading-start #x1100)
 (define-integrable jamo-leading-end   #x1113)