Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure newly discovered pair as a better priority before nominating it #463

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

thomaseizinger
Copy link
Collaborator

No description provided.

Copy link
Collaborator Author

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

YMMV but I find the max_by_key solution cleaner. Finding the pair again by prio which isn't unique sound like a bug with a ticking timer on it :)

src/ice/agent.rs Outdated Show resolved Hide resolved
@lolgesten
Copy link

You might be right, but I don't like the combinatorial logic here. Doubling up on that rather complicated .filter – hence I tried to make something easier to follow along.

@thomaseizinger
Copy link
Collaborator Author

You might be right, but I don't like the combinatorial logic here. Doubling up on that rather complicated .filter – hence I tried to make something easier to follow along.

Yeah fair. Instead of .map and max, can we use max_by instead and thus retain the CandidatePair as the returned type?

Copy link
Owner

@algesten algesten left a comment

Choose a reason for hiding this comment

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

This looks good now. Let's ship it!

@algesten algesten merged commit 7ec3177 into algesten:main Feb 28, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants