Simplify code

This commit is contained in:
Kovid Goyal
2025-05-16 12:17:00 +05:30
parent 4713cc29ad
commit 59c32d19cc

View File

@@ -8,6 +8,7 @@ import (
"io"
"os"
"path/filepath"
"slices"
"strings"
"github.com/kovidgoyal/kitty/tools/tui/loop"
@@ -37,12 +38,7 @@ func (self *Input) has_mime_matching(predicate func(string) bool) bool {
if predicate(self.mime_type) {
return true
}
for _, i := range self.extra_mime_types {
if predicate(i) {
return true
}
}
return false
return slices.ContainsFunc(self.extra_mime_types, predicate)
}
func write_loop(inputs []*Input, opts *Options) (err error) {