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 time.After calls in for loops #358

Merged
merged 2 commits into from
Aug 23, 2022

Conversation

willfindlay
Copy link
Contributor

See commits.

time.After doesn't get garbage collected until it fires, so having them in a for loop like
this can be bad. In this case it's probably fine because we only iterate after the timer
fires, but let's use best practices anyway.

Signed-off-by: William Findlay <[email protected]>
Similar to previous commit, remove the time.After call and replace with a ticker to follow
best practices.

Signed-off-by: William Findlay <[email protected]>
@willfindlay willfindlay requested a review from kkourt August 23, 2022 14:03
@willfindlay willfindlay requested a review from a team as a code owner August 23, 2022 14:03
@kkourt kkourt merged commit 36de6e0 into main Aug 23, 2022
@kkourt kkourt deleted the pr/willfindlay/remove-time-after-in-for-loop branch August 23, 2022 14:34
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