Update level's first watermark, and return overall first. */
| 195 | |
| 196 | /* Update level's first watermark, and return overall first. */ |
| 197 | static const struct timer *first_for_level(struct timers *timers, |
| 198 | size_t level, |
| 199 | const struct timer *level_first, |
| 200 | const struct timer *first) |
| 201 | { |
| 202 | if (level_first) { |
| 203 | timers->firsts[level] = level_first->time; |
| 204 | if (!first || level_first->time < first->time) |
| 205 | first = level_first; |
| 206 | } else { |
| 207 | timers->firsts[level] = -1ULL; |
| 208 | } |
| 209 | return first; |
| 210 | } |
| 211 | |
| 212 | static bool level_may_beat(const struct timers *timers, size_t level, |
| 213 | const struct timer *first) |