diff options
Diffstat (limited to 'pkg/cheatsheet/generate.go')
-rw-r--r-- | pkg/cheatsheet/generate.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pkg/cheatsheet/generate.go b/pkg/cheatsheet/generate.go index ecb75f935..04d8d3fd5 100644 --- a/pkg/cheatsheet/generate.go +++ b/pkg/cheatsheet/generate.go @@ -141,12 +141,11 @@ outer: if existing == nil { contextAndViewBindingMap[key] = []*types.Binding{binding} } else { - for _, navBinding := range contextAndViewBindingMap[key] { - if navBinding.Description == binding.Description { - continue outer - } + if !slices.Some(contextAndViewBindingMap[key], func(navBinding *types.Binding) bool { + return navBinding.Description == binding.Description + }) { + contextAndViewBindingMap[key] = append(contextAndViewBindingMap[key], binding) } - contextAndViewBindingMap[key] = append(contextAndViewBindingMap[key], binding) } continue outer |