-
Notifications
You must be signed in to change notification settings - Fork 278
Fixed comparison function for non-network address families #557
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Keith Horton <khorton@microsoft.com>
|
is it possible to create a test for this and similar cases? |
| const auto comparison{::memcmp(&lhs.m_sockaddr.Ipv6, &rhs.m_sockaddr.Ipv6, sizeof(SOCKADDR_IN6))}; | ||
| return comparison < 0 ? -1 : (comparison > 0 ? 1 : 0); |
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.
Does anything take a dependency on this returning exactly -1, 0, or 1? Seems easier and more efficient to just return ::memcmp(...)
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.
yeah. I thought about making it do just that. I'm going to add tests for this oddball scenario. I might change to just return what memcmp returns then.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Found through a separate tool when I manually copied this header to that project.