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

Function find_first

ccan/ccan/timer/timer.c:181–194  ·  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

179/* We don't need to search past the first at level 0, since the
180 * bucket range is 1; they're all the same. */
181static const struct timer *find_first(const struct list_head *list,
182 unsigned int level,
183 const struct timer *prev)
184{
185 struct timer *t;
186
187 list_for_each(list, t, list) {
188 if (!prev || t->time < prev->time)
189 prev = t;
190 if (level == 0)
191 break;
192 }
193 return prev;
194}
195
196/* Update level's first watermark, and return overall first. */
197static 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