Skip to content

Conversation

@woshilapin
Copy link
Contributor

@woshilapin woshilapin commented Nov 7, 2025

Since a HashSet is based on a HashMap<T, ()>, values in the HashSet are indexed. Therefore, we shouldn't need to iterate in the HashSet to find a value. The problem is that we would need a full EtcsLevel2 value with the correct brake_params to find it. But thanks to the Borrow trait, we don't need a full SupportingSignalingSystem for finding, we can tell to only find based on the variant, not the content of the variant. And in our case, it actually makes a lot of sense since we do ignore the payload from the Hash implementation.

@github-actions github-actions bot added the area:editoast Work on Editoast Service label Nov 7, 2025
@woshilapin woshilapin marked this pull request as ready for review November 7, 2025 17:54
@woshilapin woshilapin requested a review from a team as a code owner November 7, 2025 17:54
Copy link
Contributor

@leovalais leovalais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fun, a bit worried about the raw strings where typos can result in annoying bugs. Maybe we could define constants and use them instead? But I'm fine without as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editoast Work on Editoast Service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants