Skip to content

dev: use slice of pointers #5854

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

Merged
merged 1 commit into from
Jun 2, 2025
Merged

dev: use slice of pointers #5854

merged 1 commit into from
Jun 2, 2025

Conversation

ldez
Copy link
Member

@ldez ldez commented Jun 2, 2025

result.Issue are large structures, and we have to create a copy to iterate over them or use index, so it's better to use slices of pointers instead of slices of structures.

google/go-github#180

@ldez ldez added this to the v2-unreleased milestone Jun 2, 2025
@ldez ldez requested a review from bombsimon June 2, 2025 12:55
@ldez ldez added the topic: cleanup Related to code, process, or doc cleanup label Jun 2, 2025
@ldez ldez force-pushed the feat/issues-pointer branch from aacfb9f to 6280228 Compare June 2, 2025 12:56
@ldez ldez force-pushed the feat/issues-pointer branch from 6280228 to dd74ed8 Compare June 2, 2025 12:59
Copy link
Member

@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

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

LGTM! Did you benchmark this? Manually or with some bench tests?

Mostly just curious how big the difference is, would be interesting to know.

@ldez
Copy link
Member Author

ldez commented Jun 2, 2025

The advantage is more related to usage than performance because we mainly used indexes.

@bombsimon
Copy link
Member

The advantage is more related to usage than performance because we mainly used indexes.

Yeah makes sense, saw the linked issue and changes, was mostly curious if it had any implications at all. The changes looks good and simplifies code though so LGTM

@ldez ldez merged commit f851497 into golangci:main Jun 2, 2025
18 checks passed
@ldez ldez deleted the feat/issues-pointer branch June 2, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cleanup Related to code, process, or doc cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants