-
Notifications
You must be signed in to change notification settings - Fork 204
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
Replace remove() with setting to null #2987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On line 1098, where it says:
if (sent_packets[pn_space][ack.largest_acked] &&
IncludesAckEliciting(newly_acked_packets)):
latest_rtt =
Should you instead be really clear and say:
if (sent_packets[pn_space][ack.largest_acked] != null &&
IncludesAckEliciting(newly_acked_packets)):
latest_rtt =
It's a matter of taste, but I don't really like setting values to null when null is not defined value in a set. Removing something from a set is mathematically well defined. That Javascript happens to be weird doesn't have to affect a specification. |
Co-Authored-By: Martin Thomson <mt@lowentropy.net>
@mikkelfj I was happy with remove() as well but two issues were filed that both seemed to indicate that using remove() was confusing. I'm open to other resolutions as well(or doing nothing). |
I personally would prefer to keep remove(x) and use something like contains(x) on the test, but I trust Ian's judgment. |
I suspect the issues are about operational behaviour more than formalism, and a null test is just a proposed solution. If so, I think remove and contains is a much better approach. |
Per @martinthomson suggestion, use contains() instead of the implicit check. Fixes #2569 An alternative to #2987
I created a 1-line PR #3015 to use contains(). I slightly prefer that one to this one. |
I like #3015 better. |
Per @martinthomson suggestion, use contains() instead of the implicit check. Fixes #2569 An alternative to #2987
Fixes #2569