Closed thomaseizinger closed 1 month ago
Could we filter them instead?
As I see it,
Candidate
should not have a state. The discarded flag is probably there or convenience, but we don't want it. Especially not in public API.
Yeah definitely. So local_candidates
and remote_candidates
always filtered by !discarded
?
Shall we move them to a different collection perhaps so we can remove the state?
I think because we use usize indexes to the vec holding them, we can't move them out easily. We could make some wrapper Entry type to hold the state and candidate though.
I think because we use usize indexes to the vec holding them, we can't move them out easily. We could make some wrapper Entry type to hold the state and candidate though.
Hmm, right. Perhaps a slab
would help here?
This is useful / necessary to differentiate between active and invalidated candidates when accessing them via
IceAgent::local_candidates
.Alternatively, we could also filter them directly there or prune all discarded candidates from the agent?