Sometimes naive is best. */
| 593 | |
| 594 | /* Sometimes naive is best. */ |
| 595 | static struct hook_node *get_best_candidate(struct hook_node *graph) |
| 596 | { |
| 597 | struct hook_node *best = NULL; |
| 598 | |
| 599 | for (size_t i = 0; i < tal_count(graph); i++) { |
| 600 | if (graph[i].finished) |
| 601 | continue; |
| 602 | if (graph[i].num_incoming != 0) |
| 603 | continue; |
| 604 | if (!best |
| 605 | || best->hook->plugin->index > graph[i].hook->plugin->index) |
| 606 | best = &graph[i]; |
| 607 | } |
| 608 | return best; |
| 609 | } |
| 610 | |
| 611 | static struct plugin **plugin_hook_make_ordered(const tal_t *ctx, |
| 612 | struct logger *log, |
no outgoing calls
no test coverage detected