Skip to content

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 waiting for: contributor feedback Requires additional feedback label Dec 2, 2024
@ldez ldez self-requested a review December 2, 2024 17:53
@ldez ldez added declined and removed waiting for: contributor feedback 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