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