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

connection_string: remove redundant nil check #421

Merged
merged 1 commit into from
Aug 11, 2023
Merged

connection_string: remove redundant nil check #421

merged 1 commit into from
Aug 11, 2023

Conversation

Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Aug 5, 2023

An additional nil check for q before the loop is unnecessary because q is a map. A nil map is equivalent to an empty map. (Example: https://go.dev/play/p/EnnDEF7svOd)

Before:

	if q != nil {
		for key, val := range q {
			...
		}
	}

After:

	for key, val := range q {
		...
	}

An additional nil check for `q` before the loop is unnecessary because
`q` is a `map`. A nil `map` is equivalent to an empty map.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@sijms sijms closed this Aug 11, 2023
@sijms sijms reopened this Aug 11, 2023
@sijms sijms merged commit d4dadd1 into sijms:master Aug 11, 2023
1 of 3 checks passed
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