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

Function find_first

ccan/ccan/timer/timer.c:189–202  ·  view source on GitHub ↗

We don't need to search past the first at level 0, since the * bucket range is 1; they're all the same. */

Source from the content-addressed store, hash-verified

187/* We don't need to search past the first at level 0, since the
188 * bucket range is 1; they're all the same. */
189static const struct timer *find_first(const struct list_head *list,
190 unsigned int level,
191 const struct timer *prev)
192{
193 struct timer *t;
194
195 list_for_each(list, t, list) {
196 if (!prev || t->time < prev->time)
197 prev = t;
198 if (level == 0)
199 break;
200 }
201 return prev;
202}
203
204/* Update level's first watermark, and return overall first. */
205static const struct timer *first_for_level(struct timers *timers,

Callers 2

brute_force_firstFunction · 0.85
get_firstFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected