Commits

Atte Kojo committed 721aacb

Use a better way to calculate string length.

Comments (0)

Files changed (1)

 value mm_hash2(value data)
 {
     CAMLparam1(data);
-    unsigned int h = Murmurhash2(String_val(data),
-                                 Wosize_val(data) * sizeof(long), 0)
+    int len = caml_string_length(data);
+    unsigned int h = Murmurhash2(String_val(data), len, 0);
     CAMLreturn(Long_val(h));
 }