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

refactor: clarify filter func return val meaning #2958

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

WofWca
Copy link
Member

@WofWca WofWca commented Nov 24, 2024

Description

This should it easier to understand whether you're supposed to return true or false.
I know it's pretty much the standard that true is for keep, but this is a simple change that should make developers think less.

The same change probably should be implemented for pion/ice, where these functions are actually invoked.

Reference issue

No

Copy link

codecov bot commented Nov 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.64%. Comparing base (7c76e09) to head (333cc2b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
settingengine.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2958      +/-   ##
==========================================
- Coverage   77.79%   77.64%   -0.16%     
==========================================
  Files          89       89              
  Lines       10515    10515              
==========================================
- Hits         8180     8164      -16     
- Misses       1845     1857      +12     
- Partials      490      494       +4     
Flag Coverage Δ
go 79.19% <0.00%> (-0.17%) ⬇️
wasm 63.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WofWca WofWca force-pushed the refactor-clarify-filter-predicate branch from e77b481 to 329ddf1 Compare November 24, 2024 21:10
@WofWca
Copy link
Member Author

WofWca commented Nov 24, 2024

CI failures seem unrelated?

The behavior of SetInterfaceFilter and SetIPFilter isn't obvious. Name
the bool so the user understands the behavior from the function
definition.
@Sean-Der Sean-Der force-pushed the refactor-clarify-filter-predicate branch from 329ddf1 to 333cc2b Compare November 26, 2024 04:14
@Sean-Der
Copy link
Member

Great change, thank you @WofWca !

@Sean-Der Sean-Der merged commit 345d574 into pion:master Nov 26, 2024
16 of 17 checks passed
WofWca added a commit to WofWca/pion-ice that referenced this pull request Nov 26, 2024
This should make it clear that you need to return `true`
to keep it and `false` to exclude.

Similar MR in pion/webrtc: pion/webrtc#2958.
Sean-Der pushed a commit to WofWca/pion-ice that referenced this pull request Nov 26, 2024
This should make it clear that you need to return `true`
to keep it and `false` to exclude.

Relates to pion/webrtc#2958
Sean-Der pushed a commit to pion/ice that referenced this pull request Nov 26, 2024
This should make it clear that you need to return `true`
to keep it and `false` to exclude.

Relates to pion/webrtc#2958
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants