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

Boolean AND expression with identical left and right sides #6313

Open
chavacava opened this issue Oct 1, 2022 · 0 comments
Open

Boolean AND expression with identical left and right sides #6313

chavacava opened this issue Oct 1, 2022 · 0 comments

Comments

@chavacava
Copy link

In the following conditional, the Boolean expressions at both sides of the && operator are identical

cds/engine/api/workflow/dao.go

Lines 1088 to 1090 in 77a1606

if !sdk.IsInInt64Array(int64(i), duplicateHookIdx) && !sdk.IsInInt64Array(int64(i), duplicateHookIdx) {
duplicateHookIdx = append(duplicateHookIdx, int64(j))
}

It seems to be a typo in the slice index: one should be i and the other should be j:

!sdk.IsInInt64Array(int64(i), duplicateHookIdx) && !sdk.IsInInt64Array(int64(j), duplicateHookIdx)

Found with revive

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 a pull request may close this issue.

1 participant