Skip to content

fix: collapse identical if/else branches in AppStoreApplicationVersionRepository.FindWithFilter (#6030) - #7032

Open
absaar-404 wants to merge 1 commit into
devtron-labs:mainfrom
absaar-404:fix/6030-identical-if-branches
Open

fix: collapse identical if/else branches in AppStoreApplicationVersionRepository.FindWithFilter (#6030)#7032
absaar-404 wants to merge 1 commit into
devtron-labs:mainfrom
absaar-404:fix/6030-identical-if-branches

Conversation

@absaar-404

Copy link
Copy Markdown

What

All branches of the if/else-if construct in FindWithFilter executed the identical statement:

_, err = impl.dbConnection.Query(&appStoreWithVersion, query, queryParams...)

The query and queryParams are fully built before the branch, so the branching on ChartRepoId/RegistryId was dead code. Collapsed the four identical branches into a single call.

Why

Reported by the revive linter. Removes confusing dead branching with no behavior change.

Fixes #6030

…ory.FindWithFilter

All branches of the if/else-if construct executed the identical statement
'impl.dbConnection.Query(&appStoreWithVersion, query, queryParams...)'.
The query and queryParams are fully built beforehand, so the branching on
ChartRepoId/RegistryId was dead code. Collapsed to a single call.

Fixes devtron-labs#6030
@bito-code-review

Copy link
Copy Markdown

Bito Review Skipped - Source Branch Not Found

Bito didn't review this change because the pull request is no longer valid. It may have been merged, or the source/target branch may no longer exist.

@sonarqubecloud

Copy link
Copy Markdown

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 this pull request may close these issues.

All branches of if-then-elseif construction are identical

1 participant