浏览代码

No, don't parallelize; use weighed key comparison.

Stefano Cossu 6 年之前
父节点
当前提交
9ae394aa24
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      lakesuperior/model/structures/keyset.pyx

+ 7 - 2
lakesuperior/model/structures/keyset.pyx

@@ -144,8 +144,13 @@ cdef class Keyset:
         """
         cdef size_t i
 
-        for i in prange(self.free_i):
-            if memcmp(val, self.data + i, TRP_KLEN) == 0:
+        for i in range(self.free_i):
+            # o is least likely to match.
+            if (
+                val[0][2] == self.data[i][2] and
+                val[0][0] == self.data[i][0] and
+                val[0][1] == self.data[i][1]
+            ):
                 return True
         return False