From 983508d80442a85b78118e6c6a03d5ae4897e4df Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 4 Jan 2022 10:35:26 +0100 Subject: prog: pass ctx by pointer to ForeachType callback This will allow callbacks to stop iteration early by setting ctx.Stop flag (as it works for ForeachArg). --- prog/prio.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/prio.go') diff --git a/prog/prio.go b/prog/prio.go index 4cf3daf90..c89869b95 100644 --- a/prog/prio.go +++ b/prog/prio.go @@ -67,7 +67,7 @@ func (target *Target) calcStaticPriorities() [][]int32 { func (target *Target) calcResourceUsage() map[string]map[int]weights { uses := make(map[string]map[int]weights) - ForeachType(target.Syscalls, func(t Type, ctx TypeCtx) { + ForeachType(target.Syscalls, func(t Type, ctx *TypeCtx) { c := ctx.Meta switch a := t.(type) { case *ResourceType: -- cgit mrf-deployment