simplify check for non-zero content in set()

There's no point in casting to list just to compare to [], since
set/list/tuple will evaluate to false when empty. So we can do less work
in fewer characters.
This commit is contained in:
Eli Schwartz 2019-07-22 20:25:53 -04:00
parent 8b75e8c3e3
commit 3959c4fdca
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -429,7 +429,7 @@ class EmailMixin(object): # {{{
dbfmts = self.library_view.model().db.formats(id, index_is_id=True)
formats = [f.lower() for f in (dbfmts.split(',') if dbfmts else
[])]
if list(set(formats).intersection(available_input_formats())) != [] and list(set(fmts).intersection(available_output_formats())) != []:
if set(formats).intersection(available_input_formats()) and set(fmts).intersection(available_output_formats()):
auto.append(id)
else:
bad.append(self.library_view.model().db.title(id, index_is_id=True))