ovh/cds

Boolean AND expression with identical left and right sides

chavacava opened this issue · 0 comments

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