Commits

Atte Kojo  committed 721aacb

Use a better way to calculate string length.

  • Participants
  • Parent commits 03e477e

Comments (0)

Files changed (1)

File memcached_native.c

 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));
 }