Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

avoid assigning a function to a variable #239

Merged
merged 1 commit into from
Feb 12, 2021
Merged

Conversation

marten-seemann
Copy link
Contributor

No functional change expected. I believe defining the function on the struct itself is more efficient than assigning it to a variable.
Really, a lambda should only be used to capture a variable, which is not done here.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

I assume go is decent at optimizing this, but you're right. This is cleaner.

@Stebalien Stebalien merged commit 56b6262 into master Feb 12, 2021
@marten-seemann marten-seemann deleted the avoid-func-in-variable branch March 13, 2021 11:38
@Stebalien Stebalien mentioned this pull request May 11, 2021
27 tasks
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants