Update level's first watermark, and return overall first. */
| 203 | |
| 204 | /* Update level's first watermark, and return overall first. */ |
| 205 | static const struct timer *first_for_level(struct timers *timers, |
| 206 | size_t level, |
| 207 | const struct timer *level_first, |
| 208 | const struct timer *first) |
| 209 | { |
| 210 | if (level_first) { |
| 211 | timers->firsts[level] = level_first->time; |
| 212 | if (!first || level_first->time < first->time) |
| 213 | first = level_first; |
| 214 | } else { |
| 215 | timers->firsts[level] = -1ULL; |
| 216 | } |
| 217 | return first; |
| 218 | } |
| 219 | |
| 220 | static bool level_may_beat(const struct timers *timers, size_t level, |
| 221 | const struct timer *first) |