Skip to content

Commit 44a2e75

Browse files
committedJan 20, 2025·
internal/core/adt: prepare to differentiate types of arcs and notify
Currently both arrays use ccArc. But this is confusing as not all fields are used by both. This makes the dependency code more complex than necessary. It will result in a bit more code, but allows for more clarity in further refactoring. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I35e84d0831433ad88e7a9773c36642b483285e7b Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207452 Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent ba0639e commit 44a2e75

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed
 

‎internal/core/adt/dep.go

+16-10
Original file line numberDiff line numberDiff line change
@@ -374,19 +374,25 @@ func (n *nodeContext) breakIncomingDeps() {
374374
if src.src.IsDisjunct {
375375
continue
376376
}
377-
var a *ccArc
378377
switch r.kind {
379378
case ARC:
380-
a = &src.arcs[r.index]
379+
a := &src.arcs[r.index]
380+
if a.decremented {
381+
continue
382+
}
383+
a.decremented = true
384+
385+
src.src.unify(n.ctx, needTasksDone, attemptOnly)
386+
a.dst.decDependent(n.ctx, ARC, src)
381387
case NOTIFY:
382-
a = &src.notify[r.index]
388+
a := &src.notify[r.index]
389+
if a.decremented {
390+
continue
391+
}
392+
a.decremented = true
393+
394+
src.src.unify(n.ctx, needTasksDone, attemptOnly)
395+
a.dst.decDependent(n.ctx, NOTIFY, src)
383396
}
384-
if a.decremented {
385-
continue
386-
}
387-
a.decremented = true
388-
389-
src.src.unify(n.ctx, needTasksDone, attemptOnly)
390-
a.dst.decDependent(n.ctx, r.kind, src)
391397
}
392398
}

0 commit comments

Comments
 (0)
Please sign in to comment.