callbacks.pyx 879 B

123456789101112131415161718192021222324252627282930313233
  1. from lakesuperior.model.base cimport KeyIdx, TripleKey
  2. cdef bint lookup_sk_cmp_fn(
  3. const TripleKey* spok, const KeyIdx* k1, const KeyIdx* k2
  4. ):
  5. return spok[0] == k1
  6. cdef bint lookup_pk_cmp_fn(
  7. const TripleKey* spok, const KeyIdx* k1, const KeyIdx* k2
  8. ):
  9. return spok[1] == k1
  10. cdef bint lookup_ok_cmp_fn(
  11. const TripleKey* spok, const KeyIdx* k1, const KeyIdx* k2
  12. ):
  13. return spok[2] == k1
  14. cdef bint lookup_skpk_cmp_fn(
  15. const TripleKey* spok, const KeyIdx* k1, const KeyIdx* k2
  16. ):
  17. return spok[0] == k1 and spok[1] == k2
  18. cdef bint lookup_skok_cmp_fn(
  19. const TripleKey* spok, const KeyIdx* k1, const KeyIdx* k2
  20. ):
  21. return spok[0] == k1 and spok[2] == k2
  22. cdef bint lookup_pkok_cmp_fn(
  23. const TripleKey* spok, const KeyIdx* k1, const KeyIdx* k2
  24. ):
  25. return spok[1] == k1 and spok[2] == k2