internal/core/adt: remove taskPos field from scheduler
taskPos was a struct field tracking the index of the next
unprocessed task. Convert it to a local variable in
process(), which is the only caller. This reduces scheduler
state and is a prerequisite for letting process() handle
only the tasks required by its needs argument in future.
Also add a sanity check in insertTask that panics when a
task has no completes condition, catching invalid task
registrations early.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I02972bf15d3014d594a363da5d33698ed942fdb3
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1236063
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>