minor code improvement

minor code improvement 
from repeated assignments in loops to initialize outside the loop
This commit is contained in:
csDengh 2023-03-06 09:00:40 +08:00 committed by GitHub
parent d48b8167f7
commit f762145e06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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())