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

Cleanup: two optimizations #755

Merged
merged 3 commits into from
Dec 5, 2023
Merged

Cleanup: two optimizations #755

merged 3 commits into from
Dec 5, 2023

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Dec 5, 2023

  1. Prefer strings.Cut to strings.Split (also, supply explicit capacity initializing slices when straightforward)
  2. Prefer map[T]struct{} to map[T]bool when empty & false are equivalent (also, don't need to pass map by pointer, since map is a pointer)

1. Prefer strings.Cut to strings.Split
2. Prefer map[T]struct{} to map[T]bool when empty & false are equivalent
@serprex serprex enabled auto-merge (squash) December 5, 2023 15:53
@serprex serprex merged commit 11197a0 into main Dec 5, 2023
12 checks passed
@serprex serprex deleted the strings-cut branch December 19, 2023 16:36
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.

3 participants