this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: remove dead code in process and evalStateCI

evalStateCI made two sequential getState calls on the same arc;
getState is idempotent for a given vertex, so consolidate them
into one so cycle detection and retainProcess share a single
state lookup.

Drop the "make this configurable" TODO on numCompletionStates:
the scheduler is tightly coupled to CUE's fixed condition set
(the iota block in states.go), the constant of 10 already
covers all defined conditions with headroom, and no second
consumer has materialized.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I250660922c992a545dc5959ab9b7324855e106e1
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1236066
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+6 -14
+2 -5
internal/core/adt/context.go
··· 763 763 // implement markCycle, or whether we need it at all. 764 764 // TODO: is this indirect necessary? 765 765 // arc = arc.Indirect() 766 + if s := arc.getState(c); s != nil { 767 + c.ci, _ = s.detectCycle(arc, nil, x, c.ci) 766 768 767 - if n := arc.getState(c); n != nil { 768 - c.ci, _ = n.detectCycle(arc, nil, x, c.ci) 769 - } 770 - 771 - if s := arc.getState(c); s != nil { 772 769 defer s.retainProcess().releaseProcess() 773 770 774 771 origNeeds := state.condition
+4 -9
internal/core/adt/sched.go
··· 241 241 return c&x == x 242 242 } 243 243 244 - const numCompletionStates = 10 // TODO: make this configurable 244 + const numCompletionStates = 10 245 245 246 246 // A scheduler represents the set of outstanding tasks for a node. 247 247 type scheduler struct { ··· 441 441 t := s.tasks[taskPos] 442 442 taskPos++ 443 443 444 - if t.state != taskREADY { 445 - // TODO(perf): Figure out how it is possible to reach this and if we 446 - // should optimize. 447 - // panic("task not READY") 448 - } 449 - 450 444 switch { 451 445 case t.state == taskRUNNING: 452 446 // TODO: we could store the current referring node that caused ··· 455 449 // mark the cycle as a generation counter, instead of a boolean 456 450 // value, so that it will be trivial reconstruct a detailed cycle 457 451 // report when generating an error message. 458 - 459 452 case t.state != taskREADY: 460 - 453 + // TODO(perf): Figure out how it is possible to reach this and if we 454 + // should optimize. 455 + // panic("task not READY") 461 456 default: 462 457 runTask(t, mode) 463 458 }