this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <mpvl@gmail.com>
Change-Id: I35e84d0831433ad88e7a9773c36642b483285e7b
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207452
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+16 -10
+16 -10
internal/core/adt/dep.go
··· 374 374 if src.src.IsDisjunct { 375 375 continue 376 376 } 377 - var a *ccArc 378 377 switch r.kind { 379 378 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) 381 387 case NOTIFY: 382 - a = &src.notify[r.index] 383 - } 384 - if a.decremented { 385 - continue 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) 386 396 } 387 - a.decremented = true 388 - 389 - src.src.unify(n.ctx, needTasksDone, attemptOnly) 390 - a.dst.decDependent(n.ctx, r.kind, src) 391 397 } 392 398 }