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

Remove extra allocations from Log.NewEvent() #628

Merged
merged 3 commits into from
Jul 10, 2022
Merged

Conversation

martinsadw
Copy link
Contributor

The current implementation of Log.NewEvent() accepts a variadic parameter which causes a lot of unnecessary allocations.

I've changed all the calls to Log.NewEvent() to only pass the first three parameters and instead make chain calls to Write() for each additional (key, value) pair.

I also updated the AST walking script to work recursively and automatically format the code without needing to run gofmt -w .. If you want I can also push those changes.

@srliao srliao merged commit 2e94e1f into genshinsim:next Jul 10, 2022
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.

2 participants