Skip to content

Commit 34d7a58

Browse files
committed
style: invert dSet condition to eliminate empty branch
1 parent cddd422 commit 34d7a58

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

mdl/backend/mpr/workflow_mutator.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ func (m *mprWorkflowMutator) SetActivityProperty(activityRef string, atPos int,
171171
{Key: "$Type", Value: "Workflows$PageReference"},
172172
{Key: "Page", Value: value},
173173
}
174-
if dSet(actDoc, "TaskPage", pageRef) {
175-
// TaskPage key exists (nil value) — replaced in place via dSet.
176-
} else {
174+
if !dSet(actDoc, "TaskPage", pageRef) {
177175
// TaskPage key absent — append to activity and replace in BSON tree.
178176
actDoc = append(actDoc, bson.E{Key: "TaskPage", Value: pageRef})
179177
m.replaceActivity(actDoc)

0 commit comments

Comments
 (0)