projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c853170
)
Normalize strings prior to hashing so equivalent sequences hash the same.
author
Chris Hanson
<org/chris-hanson/cph>
Wed, 29 Mar 2017 04:52:44 +0000
(21:52 -0700)
committer
Chris Hanson
<org/chris-hanson/cph>
Wed, 29 Mar 2017 04:52:44 +0000
(21:52 -0700)
I've arbitrarily chosen NFD because its faster than NFC, but a case could be
made that NFC is preferable.
src/runtime/ustring.scm
patch
|
blob
|
history
diff --git
a/src/runtime/ustring.scm
b/src/runtime/ustring.scm
index 073380e10c0029f6ed2cb66d597842063c244625..af79646ce3e915f7da732e543ae92d23072e58c6 100644
(file)
--- a/
src/runtime/ustring.scm
+++ b/
src/runtime/ustring.scm
@@
-1598,7
+1598,7
@@
USA.
string))
(define (string-hash string #!optional modulus)
- (let ((string* (string-for-primitive
string
)))
+ (let ((string* (string-for-primitive
(string->nfd string)
)))
(if (default-object? modulus)
((ucode-primitive string-hash) string*)
((ucode-primitive string-hash-mod) string* modulus))))