| 365 | } |
| 366 | |
| 367 | static void remove_chan_from_node(struct gossmap *map, |
| 368 | struct gossmap_node *node, |
| 369 | u32 chanidx) |
| 370 | { |
| 371 | size_t i; |
| 372 | |
| 373 | if (node->num_chans == 1) { |
| 374 | remove_node(map, node); |
| 375 | return; |
| 376 | } |
| 377 | for (i = 0; node->chan_idxs[i] != chanidx; i++) |
| 378 | assert(i < node->num_chans); |
| 379 | |
| 380 | memmove(node->chan_idxs + i, |
| 381 | node->chan_idxs + i + 1, |
| 382 | sizeof(node->chan_idxs[0]) * (node->num_chans - i - 1)); |
| 383 | node->num_chans--; |
| 384 | } |
| 385 | |
| 386 | void gossmap_remove_chan(struct gossmap *map, struct gossmap_chan *chan) |
| 387 | { |
no test coverage detected