mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
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:
parent
8b75e8c3e3
commit
3959c4fdca
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user