Blame 0012-simplify-check-for-non-zero-content-in-set.patch

5f720ea
From 7669bfdedb8baeca2230430e219c97e700727777 Mon Sep 17 00:00:00 2001
5f720ea
From: Eli Schwartz <eschwartz@archlinux.org>
5f720ea
Date: Mon, 22 Jul 2019 20:25:53 -0400
5f720ea
Subject: [PATCH 12/71] simplify check for non-zero content in set()
5f720ea
5f720ea
There's no point in casting to list just to compare to [], since
5f720ea
set/list/tuple will evaluate to false when empty. So we can do less work
5f720ea
in fewer characters.
5f720ea
---
5f720ea
 src/calibre/gui2/email.py | 2 +-
5f720ea
 1 file changed, 1 insertion(+), 1 deletion(-)
5f720ea
5f720ea
diff --git a/src/calibre/gui2/email.py b/src/calibre/gui2/email.py
5f720ea
index 8b07edaa3e..1f348af3f5 100644
5f720ea
--- a/src/calibre/gui2/email.py
5f720ea
+++ b/src/calibre/gui2/email.py
5f720ea
@@ -429,7 +429,7 @@ class EmailMixin(object):  # {{{
5f720ea
                     dbfmts = self.library_view.model().db.formats(id, index_is_id=True)
5f720ea
                     formats = [f.lower() for f in (dbfmts.split(',') if dbfmts else
5f720ea
                         [])]
5f720ea
-                    if list(set(formats).intersection(available_input_formats())) != [] and list(set(fmts).intersection(available_output_formats())) != []:
5f720ea
+                    if set(formats).intersection(available_input_formats()) and set(fmts).intersection(available_output_formats()):
5f720ea
                         auto.append(id)
5f720ea
                     else:
5f720ea
                         bad.append(self.library_view.model().db.title(id, index_is_id=True))