| 396 | } |
| 397 | |
| 398 | static void remove_chan_from_node(struct gossmap *map, |
| 399 | struct gossmap_node *node, |
| 400 | u32 chanidx) |
| 401 | { |
| 402 | size_t i; |
| 403 | |
| 404 | if (node->num_chans == 1) { |
| 405 | remove_node(map, node); |
| 406 | return; |
| 407 | } |
| 408 | for (i = 0; node->chan_idxs[i] != chanidx; i++) |
| 409 | assert(i < node->num_chans); |
| 410 | |
| 411 | memmove(node->chan_idxs + i, |
| 412 | node->chan_idxs + i + 1, |
| 413 | sizeof(node->chan_idxs[0]) * (node->num_chans - i - 1)); |
| 414 | node->num_chans--; |
| 415 | } |
| 416 | |
| 417 | void gossmap_remove_chan(struct gossmap *map, struct gossmap_chan *chan) |
| 418 | { |
no test coverage detected