MCPcopy Create free account
hub / github.com/ElementsProject/lightning / add_vals

Function add_vals

ccan/ccan/htable/test/run-debug.c:35–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static void add_vals(struct htable *ht,
36 const uint64_t val[],
37 unsigned int off, unsigned int num)
38{
39 uint64_t i;
40
41 for (i = off; i < off+num; i++) {
42 if (htable_get(ht, hash(&i, NULL), objcmp, &i)) {
43 fail("%llu already in hash", (long long)i);
44 return;
45 }
46 htable_add(ht, hash(&val[i], NULL), &val[i]);
47 if (htable_get(ht, hash(&i, NULL), objcmp, &i) != &val[i]) {
48 fail("%llu not added to hash", (long long)i);
49 return;
50 }
51 }
52 pass("Added %llu numbers to hash", (long long)i);
53}
54
55#if 0
56static void refill_vals(struct htable *ht,

Callers 1

mainFunction · 0.70

Calls 2

htable_getFunction · 0.85
hashFunction · 0.70

Tested by

no test coverage detected