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: isValidVersion readibility #2864

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CodingCookieRookie
Copy link

No description provided.

fetch_request.go Outdated
@@ -281,7 +281,7 @@ func (r *FetchRequest) headerVersion() int16 {
}

func (r *FetchRequest) isValidVersion() bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clearly not equivalent. I suspect you automated the fix and match incorrectly on <= 1 against <= 11? Personally I prefer the consistency of a range check in all the cases even when it is a simple range as it is easier to update (and easier to maintain when we switch to generating code from protocol json).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes thanks for noticing, missed those during the automated fix for all, edited it. I see, sure that makes sense as well :)

Signed-off-by: alvin <bioluminescencecloud@gmail.com>
@puellanivis
Copy link
Contributor

I’m unsure of the value of this change. There is no functional behavior change, and we lose the consistency to the version range checks elsewhere else.

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

3 participants