Searches through both tokensA and tokensB. */
| 1438 | |
| 1439 | /* Searches through both tokensA and tokensB. */ |
| 1440 | static struct node_id *first_node_with_unused_chan(const tal_t *ctx, |
| 1441 | struct splice_script_chan **channels, |
| 1442 | struct token **tokensA, |
| 1443 | size_t a_size, |
| 1444 | struct token **tokensB, |
| 1445 | size_t b_size) |
| 1446 | { |
| 1447 | for (size_t i = 0; i < tal_count(channels); i++) { |
| 1448 | bool used = false; |
| 1449 | for (size_t j = 0; j < a_size; j++) |
| 1450 | if (matches_chan_id(tokensA[j], channels[i]->chan_id)) |
| 1451 | used = true; |
| 1452 | for (size_t k = 0; k < b_size; k++) |
| 1453 | if (matches_chan_id(tokensB[k], channels[i]->chan_id)) |
| 1454 | used = true; |
| 1455 | if (!used) |
| 1456 | return tal_dup(ctx, struct node_id, |
| 1457 | &channels[i]->node_id); |
| 1458 | } |
| 1459 | |
| 1460 | return NULL; |
| 1461 | } |
| 1462 | |
| 1463 | static struct channel_id *chan_for_node_index(const tal_t *ctx, |
| 1464 | struct splice_script_chan **channels, |
no test coverage detected