Skip to content

Commit 8fef4d3

Browse files
committed
internal/core/adt: remove unused code low-hanging fruit
Remove a field and type which are entirely unused, and three functions which have not been used for a while either. More unused code remains, particularly constants, but these seem like the easiest ones to let go of. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Ie0100b84ed43b014cd856d1bba97edb45cb7cc81 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1212275 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 08c3542 commit 8fef4d3

File tree

4 files changed

+0
-29
lines changed

4 files changed

+0
-29
lines changed

Diff for: internal/core/adt/debug.go

-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ type mermaidContext struct {
158158

159159
hasError bool
160160

161-
refRoot map[defID]*mermaidVertex
162-
163161
// roots maps a Vertex to the analysis data for that Vertex.
164162
roots map[*Vertex]*mermaidVertex
165163

Diff for: internal/core/adt/disjunct2.go

-5
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ type disjunct struct {
205205
mode defaultMode
206206
}
207207

208-
// TODO: remove this type.
209-
type disjunctHole struct {
210-
holeID int
211-
}
212-
213208
func (n *nodeContext) scheduleDisjunction(d envDisjunct) {
214209
if len(n.disjunctions) == 0 {
215210
// This processes all disjunctions in a single pass.

Diff for: internal/core/adt/states.go

-17
Original file line numberDiff line numberDiff line change
@@ -339,20 +339,3 @@ func (n *nodeContext) scheduleTask(r *runner, env *Environment, x Node, ci Close
339339
n.insertTask(t)
340340
return t
341341
}
342-
343-
// require ensures that a given condition is met for the given Vertex by
344-
// evaluating it. It yields execution back to the scheduler if it cannot
345-
// be completed at this point.
346-
func (c *OpContext) require(v *Vertex, needs condition) {
347-
state := v.getState(c)
348-
if state == nil {
349-
return
350-
}
351-
state.process(needs, yield)
352-
}
353-
354-
// scalarValue evaluates the given expression and either returns a
355-
// concrete value or schedules the task for later evaluation.
356-
func (ctx *OpContext) scalarValue(t *task, x Expr) Value {
357-
return ctx.value(x, require(0, scalarKnown))
358-
}

Diff for: internal/core/adt/tasks.go

-5
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,6 @@ func processDisjunctions(c *OpContext, t *task, mode runMode) {
216216
t.err = CombineErrors(nil, t.err, err)
217217
}
218218

219-
func processFinalizeDisjunctions(c *OpContext, t *task, mode runMode) {
220-
n := t.node
221-
n.finalizeDisjunctions()
222-
}
223-
224219
func processListLit(c *OpContext, t *task, mode runMode) {
225220
n := t.node
226221

0 commit comments

Comments
 (0)