cue: remove use of isDef

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>
diff --git a/cue/types.go b/cue/types.go
index 71abe0a..68374c0 100644
--- a/cue/types.go
+++ b/cue/types.go
@@ -1777,17 +1777,8 @@
 	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
 	}