Skip to content

Commit 862fcf1

Browse files
committed
internal/core/adt: use a named vertexStatus constant rather than 0
"unprocessed" is much clearer than 0, and since it's not an untyped integer constant, it cannot be mixed up for other types. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I1664686a59c8a69e9e3c493bc785de072babaf89 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198625 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Matthew Sackman <[email protected]>
1 parent 9b91188 commit 862fcf1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/core/adt/disjunct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ func clone(v Vertex) Vertex {
502502
case finalized:
503503
v.Arcs[i] = arc
504504

505-
case 0:
505+
case unprocessed:
506506
a := *arc
507507
v.Arcs[i] = &a
508508

internal/core/adt/eval.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (c *OpContext) unify(v *Vertex, flags combinedFlags) {
194194
return
195195

196196
case evaluatingArcs:
197-
Assertf(c, v.status > 0, "unexpected status %d", v.status)
197+
Assertf(c, v.status > unprocessed, "unexpected status %d", v.status)
198198
return
199199

200200
case 0:
@@ -1787,7 +1787,7 @@ func (n *nodeContext) addVertexConjuncts(c Conjunct, arc *Vertex, inline bool) {
17871787
closeInfo = closeInfo.SpawnRef(arc, IsDef(x), x)
17881788
}
17891789

1790-
if arc.status == 0 && !inline {
1790+
if arc.status == unprocessed && !inline {
17911791
// This is a rare condition, but can happen in certain
17921792
// evaluation orders. Unfortunately, adding this breaks
17931793
// resolution of cyclic mutually referring disjunctions. But it

0 commit comments

Comments
 (0)