From af85f410a22ac84fe0e132e941352b2290db52fb Mon Sep 17 00:00:00 2001 From: mantuliu <240951888@qq.com> Date: Tue, 21 Feb 2023 19:30:27 +0800 Subject: [PATCH] Improve the performance of slice usage Signed-off-by: mantuliu <240951888@qq.com> --- .../volume_restrictions_test.go | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go b/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go index a56516e2f74..7007db47616 100644 --- a/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go +++ b/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go @@ -359,29 +359,6 @@ func TestAccessModeConflicts(t *testing.T) { } } -func BenchmarkHaveOverlap(b *testing.B) { - tests := []struct { - a1 []string - a2 []string - isOverlap bool - }{ - { - a1: []string{"ab", "ac", "abc", "abcd", "abcde", "abcd", "ab", "abcdef", "abcdefg", "1", "2", "3", "4", "5", "6"}, - a2: []string{"bc", "helloworld", "bcd", "bcdef", "bcde", "12", "23", "34", "45", "56", "67", "78", "89"}, - isOverlap: false, - }, - } - testError := false - for n := 0; n < b.N; n++ { - for _, test := range tests { - if !testError && haveOverlap(test.a1, test.a2) != test.isOverlap { - testError = true - b.Errorf("test haveOverlap wrong, test case is: %v", test) - } - } - } -} - func newPlugin(ctx context.Context, t *testing.T) framework.Plugin { return newPluginWithListers(ctx, t, nil, nil, nil, true) }