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 redundant nil check #2194

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Remove redundant nil check #2194

merged 1 commit into from
Aug 21, 2023

Conversation

Juneezee
Copy link
Contributor

From the Go docs:

"If the map is nil, the number of iterations is 0." https://go.dev/ref/spec#For_range

Therefore, an additional nil check for before the loop is unnecessary. Example: https://go.dev/play/p/Cw_wnqYzemu

From the Go docs:

  "If the map is nil, the number of iterations is 0." [1]

Therefore, an additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@Juneezee Juneezee requested a review from kataras as a code owner August 21, 2023 14:33
@CLAassistant
Copy link

CLAassistant commented Aug 21, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Owner

@kataras kataras left a comment

Choose a reason for hiding this comment

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

LGTM!

@kataras kataras merged commit 6a44987 into kataras:main Aug 21, 2023
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