lexicographically compares two variable-length binary streams
| 48 | |
| 49 | // lexicographically compares two variable-length binary streams |
| 50 | static int _fdb_keycmp(void *key1, size_t keylen1, void *key2, size_t keylen2) |
| 51 | { |
| 52 | if (keylen1 == keylen2) { |
| 53 | return memcmp(key1, key2, keylen1); |
| 54 | }else { |
| 55 | size_t len = MIN(keylen1, keylen2); |
| 56 | int cmp = memcmp(key1, key2, len); |
| 57 | if (cmp != 0) return cmp; |
| 58 | else { |
| 59 | return (int)((int)keylen1 - (int)keylen2); |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | static int _fdb_seqnum_cmp(struct avl_node *a, struct avl_node *b, void *aux) |
| 65 | { |
no outgoing calls
no test coverage detected