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: make parsed_scoped_addresses return addresses in the same order as all other methods #1150

Merged
merged 3 commits into from Apr 2, 2023

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Apr 2, 2023

parsed_scoped_addresses would not return addresses in the same order as the other address functions. This lead to unexpected results with the host value.

    Addresses are guaranteed to be returned in LIFO (last in, first out)
    order with IPv4 addresses first and IPv6 addresses second.

    This means the first address will always be the most recently added
    address of the given IP version.

This also improves performance of ip address handling in ServiceInfo as there were multiple conversions that can be avoided when processing IP Addresses

There were multiple conversions that can be avoided when
processing IP Addresses
@bdraco bdraco changed the title feat: improve performance of ip address handling in ServiceInfo fix: make parsed_scoped_addresses return addresses in the same order as all other methods Apr 2, 2023
@codecov
Copy link

codecov bot commented Apr 2, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.08 ⚠️

Comparison is base (d3213d7) 99.77% compared to head (7543ba1) 99.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1150      +/-   ##
==========================================
- Coverage   99.77%   99.69%   -0.08%     
==========================================
  Files          22       22              
  Lines        2614     2607       -7     
  Branches      458      457       -1     
==========================================
- Hits         2608     2599       -9     
- Misses          4        6       +2     
  Partials        2        2              
Impacted Files Coverage Δ
src/zeroconf/_services/info.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bdraco bdraco marked this pull request as ready for review April 2, 2023 20:15
@bdraco bdraco merged commit 9b6adcf into master Apr 2, 2023
19 of 27 checks passed
@bdraco bdraco deleted the ip_address_cleanups branch April 2, 2023 20:15
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

1 participant