From 177228aa1a34b95b2ab9015aa7578b39b9a03701 Mon Sep 17 00:00:00 2001 From: Shash Reddy Date: Mon, 28 Oct 2019 11:18:30 -0700 Subject: [PATCH] Address comments - Thanks to Markus for suggestion about simplify the logic to get excluded file paths --- test/test_images/runtime/handlers/runtime.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test_images/runtime/handlers/runtime.go b/test/test_images/runtime/handlers/runtime.go index 74549315781e..21d29acf5b36 100644 --- a/test/test_images/runtime/handlers/runtime.go +++ b/test/test_images/runtime/handlers/runtime.go @@ -60,14 +60,16 @@ func excludeFilePaths(filePaths []string, excludedPaths []string) []string { var paths []string for _, path := range filePaths { excluded := false - for i := len(excludedPaths) - 1; i >= 0 && !excluded; i-- { - excluded = path == excludedPaths[i] + for _, excludedPath := range excludedPaths { + if path == excludedPath { + excluded = true + break + } } if !excluded { paths = append(paths, path) } } - return paths }