Skip to content

fix: make parsed_scoped_addresses return addresses in the same order as all other methods #1150

Merged
bdraco merged 3 commits into
masterfrom
ip_address_cleanups
Apr 2, 2023
Merged

fix: make parsed_scoped_addresses return addresses in the same order as all other methods #1150
bdraco merged 3 commits into
masterfrom
ip_address_cleanups

Conversation

@bdraco

@bdraco bdraco commented Apr 2, 2023

Copy link
Copy Markdown
Member

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

codecov Bot commented Apr 2, 2023

Copy link
Copy Markdown

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
@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.

1 participant