Skip to content

Commit

Permalink
remove redundant activeOp interface
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sipsma <[email protected]>
  • Loading branch information
sipsma committed Dec 6, 2024
1 parent 8f16a38 commit fc4ecad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions solver/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (t edgeStatusType) String() string {
return []string{"initial", "cache-fast", "cache-slow", "complete"}[t]
}

func newEdge(ed Edge, op activeOp, index *edgeIndex) *edge {
func newEdge(ed Edge, op *sharedOp, index *edgeIndex) *edge {
e := &edge{
edge: ed,
op: op,
Expand All @@ -40,7 +40,7 @@ func newEdge(ed Edge, op activeOp, index *edgeIndex) *edge {

type edge struct {
edge Edge
op activeOp
op *sharedOp

edgeState
depRequests map[pipeReceiver]*dep
Expand Down
3 changes: 1 addition & 2 deletions solver/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ func (e *exporter) ExportTo(ctx context.Context, t CacheExporterTarget, opt Cach
}

if e.edge != nil {
op, ok := e.edge.op.(*sharedOp)
if ok && op != nil && op.st != nil {
if op := e.edge.op; op != nil && op.st != nil {
ctx = withAncestorCacheOpts(ctx, op)
}
}
Expand Down
9 changes: 0 additions & 9 deletions solver/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,15 +825,6 @@ type cacheMapResp struct {
complete bool
}

type activeOp interface {
CacheMap(context.Context, int) (*cacheMapResp, error)
LoadCache(ctx context.Context, rec *CacheRecord) (Result, error)
Exec(ctx context.Context, inputs []Result) (outputs []Result, exporters []ExportableCacheKey, err error)
IgnoreCache() bool
Cache() CacheManager
CalcSlowCache(context.Context, Index, PreprocessFunc, ResultBasedCacheFunc, Result) (digest.Digest, error)
}

func newSharedOp(resolver ResolveOpFunc, st *state) *sharedOp {
so := &sharedOp{
resolver: resolver,
Expand Down

0 comments on commit fc4ecad

Please sign in to comment.