You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor: replace redundant boolean closure in makeAppStageStatus with id > 0 #6992
AppStageStatus.Status is a bool, and the closure only returns id > 0. It can be written directly as Status: id > 0, which removes the branch and the per-call closure while producing the same value.
The expression form reads more directly and drops an anonymous function that runs on every call to makeAppStageStatus. This is the same redundant-branch pattern already addressed in #6030 and #6031, and it is what gosimple (S1008) reports.
Alternative
None.
Have you spent some time to check if this issue has been raised before?
Activity