Skip to content

Commit 6a60de5

Browse files
committed
internal/core/adt: move block of code
This should be a noop, but it allows hoisting a continuous block of code related to closedness processing into a separate function. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ie2dd5324b2ffbda91edbf8dd77ffb480e9607cf7 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207446 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent fc9720c commit 6a60de5

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

internal/core/adt/fields.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -671,22 +671,6 @@ func (c *closeContext) decDependent(ctx *OpContext, kind depKind, dependant *clo
671671

672672
c.done = true
673673

674-
p := c.parent
675-
676-
if c.isDef && !c.isTotal && (!c.hasTop || c.hasNonTop) {
677-
c.isClosed = true
678-
if p != nil {
679-
p.isDef = true
680-
}
681-
}
682-
683-
if c.isClosedOnce {
684-
c.isClosed = true
685-
if p != nil {
686-
p.isClosedOnce = true
687-
}
688-
}
689-
690674
for i, a := range c.arcs {
691675
cc := a.cc
692676
if a.decremented {
@@ -705,6 +689,22 @@ func (c *closeContext) decDependent(ctx *OpContext, kind depKind, dependant *clo
705689
cc.decDependent(ctx, NOTIFY, c)
706690
}
707691

692+
p := c.parent
693+
694+
if c.isDef && !c.isTotal && (!c.hasTop || c.hasNonTop) {
695+
c.isClosed = true
696+
if p != nil {
697+
p.isDef = true
698+
}
699+
}
700+
701+
if c.isClosedOnce {
702+
c.isClosed = true
703+
if p != nil {
704+
p.isClosedOnce = true
705+
}
706+
}
707+
708708
c.finalizePattern()
709709

710710
if p == nil {

0 commit comments

Comments
 (0)