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

Function check_distinct

common/json_param.c:221–232  ·  view source on GitHub ↗

* Make sure 2 sequential items in @params are not equal (based on * provided comparator). */

Source from the content-addressed store, hash-verified

219 * provided comparator).
220 */
221static void check_distinct(const struct param *params,
222 int (*compar)(const struct param *a,
223 const struct param *b, void *unused))
224{
225 const struct param *first = params;
226 const struct param *last = first + tal_count(params);
227 first++;
228 while (first != last) {
229 paramcheck_assert(compar(first - 1, first, NULL) != 0);
230 first++;
231 }
232}
233
234static void check_unique(struct param *copy,
235 int (*compar) (const struct param *a,

Callers 2

check_uniqueFunction · 0.85
check_paramsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected