From f762145e06b94245b3d903408d56dc366ef0f77f Mon Sep 17 00:00:00 2001 From: csDengh <104145355+csDengh@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:00:40 +0800 Subject: [PATCH] minor code improvement minor code improvement from repeated assignments in loops to initialize outside the loop --- pkg/scheduler/framework/runtime/framework.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scheduler/framework/runtime/framework.go b/pkg/scheduler/framework/runtime/framework.go index 1bfd12a9cb7..4bddf193760 100644 --- a/pkg/scheduler/framework/runtime/framework.go +++ b/pkg/scheduler/framework/runtime/framework.go @@ -952,8 +952,8 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy if len(plugins) > 0 { // Run Score method for each node in parallel. f.Parallelizer().Until(ctx, len(nodes), func(index int) { + nodeName := nodes[index].Name for _, pl := range plugins { - nodeName := nodes[index].Name s, status := f.runScorePlugin(ctx, pl, state, pod, nodeName) if !status.IsSuccess() { err := fmt.Errorf("plugin %q failed with: %w", pl.Name(), status.AsError())