Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove redundant nil check in WalkGitLog #26773

Merged
merged 6 commits into from
Aug 29, 2023
Merged

Remove redundant nil check in WalkGitLog #26773

merged 6 commits into from
Aug 29, 2023

Conversation

Juneezee
Copy link
Contributor

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/xCk3Oba1R_0

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>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 28, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 28, 2023
@techknowlogick
Copy link
Member

Thanks for the PR!

For anyone reviewing this, it is easier when you hide the whitespace: https://github.com/go-gitea/gitea/pull/26773/files?diff=unified&w=1

@techknowlogick techknowlogick added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Aug 28, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 28, 2023
Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

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

Feels like this could be linted for.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 28, 2023
@wxiaoguang wxiaoguang added this to the 1.21.0 milestone Aug 29, 2023
@wxiaoguang wxiaoguang added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 29, 2023
@wxiaoguang wxiaoguang enabled auto-merge (squash) August 29, 2023 00:36
@wxiaoguang wxiaoguang merged commit ad3cbbc into go-gitea:main Aug 29, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 29, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Aug 30, 2023
* giteaofficial/main:
  Use `Set[Type]` instead of `map[Type]bool/struct{}`. (go-gitea#26804)
  Fix verifyCommits error when push a new branch (go-gitea#26664)
  Fix Uint8Array comparisons and update vitest (go-gitea#26805)
  Add various missing files-changed dependencies (go-gitea#26799)
  Improve flex list item padding (go-gitea#26779)
  Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (go-gitea#26759)
  feat(API): add route and implementation for creating/updating repository secret (go-gitea#26766)
  Replace deprecated `elliptic.Marshal` (go-gitea#26800)
  Updating the js libraries to latest version. (go-gitea#26795)
  Fix some slice append usages (go-gitea#26778)
  Use Go 1.21 for golangci-lint (go-gitea#26786)
  Fix notification circle (border-radius) (go-gitea#26794)
  Fix context filter has no effect in dashboard (go-gitea#26695)
  Add default label in branch select list (go-gitea#26697)
  Remove redundant nil check in `WalkGitLog` (go-gitea#26773)
  Remove fomantic `item` module (go-gitea#26775)
  Update info regarding internet connection for build (go-gitea#26776)
  Fix being unable to use a repo that prohibits accepting PRs as a PR source. (go-gitea#26785)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 27, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants