You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/12/28 13:05:00 UTC
[GitHub] [incubator-devlake] mindlesscloud opened a new pull request, #4054: refactor: improve slice size check for gitlab
mindlesscloud opened a new pull request, #4054:
URL: https://github.com/apache/incubator-devlake/pull/4054
### Summary
The following snippet is taken from the codebase. It looks like it would result in the `index out of range error`, but the function `FindStringSubmatch` ensures this will not happen. In this PR, we improved the readability by changing the expression inside the `if` statement from `len(groups) > 0` to `len(groups) > 1`
```go
groups := labelTypeRegex.FindStringSubmatch(label)
if len(groups) > 0 {
gitlabMergeRequest.Type = groups[1]
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] mindlesscloud merged pull request #4054: refactor: improve slice size check for gitlab
Posted by GitBox <gi...@apache.org>.
mindlesscloud merged PR #4054:
URL: https://github.com/apache/incubator-devlake/pull/4054
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org