Skip to content

Commit 86cc092

Browse files
committed
finalizing
1 parent ec5f650 commit 86cc092

2 files changed

Lines changed: 0 additions & 50 deletions

File tree

pkg/catalog/index/filter.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -184,23 +184,6 @@ func (f *Filter) matchesIncludes(m *Metadata) bool {
184184
return true
185185
}
186186

187-
// matchesID checks if template ID matches pattern (supports wildcards).
188-
// Deprecated: replaced by matchesIncludeID, only here for benchmark (and PR)
189-
// TODO: Remove before PR merged.
190-
func matchesID(templateID, pattern string) bool {
191-
// Convert to lowercase for case-insensitive matching
192-
templateID = strings.ToLower(templateID)
193-
pattern = strings.ToLower(pattern)
194-
195-
if templateID == pattern {
196-
return true
197-
}
198-
199-
matched, _ := filepath.Match(pattern, templateID)
200-
201-
return matched
202-
}
203-
204187
// Compile pre-processes IDs and ExcludeIDs into fast lookup structures.
205188
// The first time Matches is called, this is called automatically.
206189
// If IDs or ExcludeIDs are modified after calling Matches, this must be called manually.

pkg/catalog/index/filter_bench_test.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -59,36 +59,3 @@ func BenchmarkFilterMatches(b *testing.B) {
5959
})
6060
}
6161
}
62-
63-
func BenchmarkFilterMatches_Old(b *testing.B) {
64-
corpus := makeMetadataCorpus(templateCount)
65-
66-
cases := []struct{ exact, wildcards int }{
67-
{10, 0},
68-
{100, 0},
69-
{1000, 0},
70-
{100, 1},
71-
{100, 3},
72-
{100, 5},
73-
}
74-
75-
for _, tc := range cases {
76-
b.Run(fmt.Sprintf("ids=%d,patterns=%d", tc.exact, tc.wildcards), func(b *testing.B) {
77-
b.ReportAllocs()
78-
79-
ids := mixedFilter(tc.exact, tc.wildcards).IDs
80-
for b.Loop() {
81-
for _, meta := range corpus {
82-
matched := false
83-
for _, id := range ids {
84-
if matchesID(meta.ID, id) {
85-
matched = true
86-
break
87-
}
88-
}
89-
_ = matched
90-
}
91-
}
92-
})
93-
}
94-
}

0 commit comments

Comments
 (0)