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 in HasErrorLabel #1369

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Remove redundant nil check in HasErrorLabel #1369

merged 1 commit into from
Sep 25, 2023

Conversation

Juneezee
Copy link
Contributor

Summary

From the Go specification:

"1. For a nil slice, 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/eSKOAOz0K0M

Background & Motivation

@Juneezee Juneezee requested a review from a team as a code owner August 31, 2023 07:50
@Juneezee Juneezee requested review from blink1073 and removed request for a team August 31, 2023 07:50
@Juneezee Juneezee temporarily deployed to api-report August 31, 2023 07:50 — with GitHub Actions Inactive
@matthewdale matthewdale self-requested a review September 1, 2023 04:40
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

API Change Report

No changes found!

matthewdale
matthewdale previously approved these changes Sep 1, 2023
Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@prestonvasquez prestonvasquez changed the base branch from master to v1 September 13, 2023 18:05
@matthewdale matthewdale changed the base branch from v1 to master September 20, 2023 18:09
@matthewdale matthewdale dismissed their stale review September 20, 2023 18:09

The base branch was changed.

From the Go specification:

  "1. For a nil slice, 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>
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thank you!

@blink1073 blink1073 merged commit a3c8def into mongodb:master Sep 25, 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