* Add comment explaining hash_string

This commit is contained in:
Matthew Honnibal 2015-07-22 13:39:42 +02:00
parent 815bda201d
commit bf77bcd6b9

View File

@ -13,6 +13,7 @@ SEPARATOR = '\n|-SEP-|\n'
cpdef hash_t hash_string(unicode string) except 0: cpdef hash_t hash_string(unicode string) except 0:
# This should probably use Py_UCS4 API, but I can't in Python2.7
chars = <Py_UNICODE*>string chars = <Py_UNICODE*>string
return hash64(chars, len(string) * sizeof(Py_UNICODE), 0) return hash64(chars, len(string) * sizeof(Py_UNICODE), 0)