Skip to content

Commit

Permalink
cue: remove use of isDef
Browse files Browse the repository at this point in the history
This seems unnecessary as the definition status is
passed down to the Closed field. It also seems
incorrect. Removing it has no effect and seems to
run slightly faster.

Change-Id: I79d9d1fd962310f1c78af7cf58e9e51c685e1d8b
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9574
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
  • Loading branch information
mpvl committed Apr 30, 2021
1 parent ed5cdf0 commit 5481b41
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions cue/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1777,17 +1777,8 @@ func (v hiddenValue) Subsumes(w Value) bool {
return p.Check(ctx, v.v, w.v)
}

func isDef(v *adt.Vertex) bool {
for ; v != nil; v = v.Parent {
if v.Label.IsDef() {
return true
}
}
return false
}

func allowed(ctx *adt.OpContext, parent, n *adt.Vertex) *adt.Bottom {
if !parent.IsClosedList() && !parent.IsClosedStruct() && !isDef(parent) {
if !parent.IsClosedList() && !parent.IsClosedStruct() {
return nil
}

Expand Down

0 comments on commit 5481b41

Please sign in to comment.