MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / dict_cmp

Function dict_cmp

cachedb/cachedb_dict.c:270–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270int dict_cmp(const cdb_dict_t *a, const cdb_dict_t *b)
271{
272 const struct list_head *p1, *p2;
273 cdb_pair_t *pair1;
274 cdb_pair_t *pair2;
275
276 if (a == b)
277 return 0;
278
279 if (!a || !b)
280 return 1;
281
282 /* different # of pairs? */
283 for (p1 = a->next, p2 = b->next; p1 != a && p2 != b;
284 p1 = p1->next, p2 = p2->next)
285 {}
286 if (p1 != a || p2 != b)
287 return 1;
288
289 list_for_each (p1, a) {
290 pair1 = list_entry(p1, cdb_pair_t, list);
291
292 pair2 = cdb_dict_fetch(&pair1->key, b);
293 if (!pair2)
294 return 1;
295
296 if ((!pair1->key.is_pk || !pair2->key.is_pk) &&
297 val_cmp(&pair1->val, &pair2->val))
298 return 1;
299 }
300
301 return 0;
302}
303
304int val_cmp(const cdb_val_t *v1, const cdb_val_t *v2)
305{

Callers 4

val_cmpFunction · 0.85
test_queryFunction · 0.85
test_query_unsetFunction · 0.85
test_map_getFunction · 0.85

Calls 3

cdb_dict_fetchFunction · 0.85
val_cmpFunction · 0.85
list_entryClass · 0.50

Tested by 3

test_queryFunction · 0.68
test_query_unsetFunction · 0.68
test_map_getFunction · 0.68