From 61ec969530484921bda6da7502d5faf9e60d9fef Mon Sep 17 00:00:00 2001 From: chavacava Date: Fri, 25 Oct 2024 13:11:46 +0200 Subject: [PATCH] removes unnecessary conditional --- engine/api/workflow/dao.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engine/api/workflow/dao.go b/engine/api/workflow/dao.go index 9450c48559..1fc1c681b6 100644 --- a/engine/api/workflow/dao.go +++ b/engine/api/workflow/dao.go @@ -1085,9 +1085,7 @@ func checkHooks(ctx context.Context, db gorp.SqlExecutor, w *sdk.Workflow, n *sd h2 := n.Hooks[j] if i != j && h.Ref() == h2.Ref() { log.ErrorWithStackTrace(ctx, sdk.NewErrorFrom(sdk.ErrWrongRequest, "invalid workflow: duplicate hook %s", model.Name)) - if !sdk.IsInInt64Array(int64(i), duplicateHookIdx) && !sdk.IsInInt64Array(int64(i), duplicateHookIdx) { - duplicateHookIdx = append(duplicateHookIdx, int64(j)) - } + duplicateHookIdx = append(duplicateHookIdx, int64(j)) } } }