MCPcopy Create free account
hub / github.com/couchbase/forestdb / _fdb_keycmp

Function _fdb_keycmp

src/iterator.cc:50–62  ·  view source on GitHub ↗

lexicographically compares two variable-length binary streams

Source from the content-addressed store, hash-verified

48
49// lexicographically compares two variable-length binary streams
50static 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
64static int _fdb_seqnum_cmp(struct avl_node *a, struct avl_node *b, void *aux)
65{

Callers 4

_fdb_wal_cmpFunction · 0.85
_fdb_key_cmpFunction · 0.85
_fdb_iterator_seq_prevFunction · 0.85
_fdb_iterator_seq_nextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected