mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-02 09:04:12 +02: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
1 changed files with 1 additions and 1 deletions
|
|
@ -429,7 +429,7 @@ def send_by_mail(self, to, fmts, delete_from_library, subject='', send_ids=None,
|
|||
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…
Reference in a new issue