Skip to content

dev: change lll impl to use bytes instead of strings #5190

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

Closed
wants to merge 1 commit into from

Conversation

alexandear
Copy link
Member

@alexandear alexandear commented Dec 2, 2024

The PR improves the implementation of getLLLIssuesForFile.

bufio.Scanner reads bytes from a file, no need to convert []byte to a string.

Also, line = bytes.ReplaceAll(line, []byte{'\t'}, tabSpaces) can be below ifs.

@ldez
Copy link
Member

ldez commented Dec 2, 2024

What are the concrete gains of this change?

@ldez ldez added the feedback required Requires additional feedback label Dec 2, 2024
@ldez ldez self-requested a review December 2, 2024 17:53
@ldez ldez added declined and removed feedback required Requires additional feedback labels Dec 2, 2024
@ldez
Copy link
Member

ldez commented Dec 2, 2024

IMO, this just decreases maintainability by adding []byte() everywhere and creating a global variable.

In the context of lll, there are no advantages to using bytes vs strings.

There are no performance improvements, and I can prove that: ldez/golangci-lint-bench#37

@ldez ldez closed this Dec 2, 2024
@alexandear alexandear deleted the dev-lll-bytes branch December 2, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants