Sometimes naive is best. */
| 604 | |
| 605 | /* Sometimes naive is best. */ |
| 606 | static struct hook_node *get_best_candidate(struct hook_node *graph) |
| 607 | { |
| 608 | struct hook_node *best = NULL; |
| 609 | |
| 610 | for (size_t i = 0; i < tal_count(graph); i++) { |
| 611 | if (graph[i].finished) |
| 612 | continue; |
| 613 | if (graph[i].num_incoming != 0) |
| 614 | continue; |
| 615 | if (!best |
| 616 | || best->hook->plugin->index > graph[i].hook->plugin->index) |
| 617 | best = &graph[i]; |
| 618 | } |
| 619 | return best; |
| 620 | } |
| 621 | |
| 622 | static struct plugin **plugin_hook_make_ordered(const tal_t *ctx, |
| 623 | struct logger *log, |
no outgoing calls
no test coverage detected