[PATCH 4/5] Short-circuit testing if root has any devices

Vratislav Podzimek vpodzime at redhat.com
Fri Mar 14 11:34:23 UTC 2014


There's no need to build the full list of devices in order to just test if there
are some or not.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/custom.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index db6fc21..f3b5870 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -481,9 +481,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         for root in ui_roots:
             # Don't make a page if none of the root's devices are left.
             # Also, only include devices in an old page if the format is intact.
-            if not [d for d in root.swaps + root.mounts.values()
+            if not any(d for d in root.swaps + root.mounts.values()
                         if d in self._devices and d.disks and
-                           (root.name == translated_new_install_name() or d.format.exists)]:
+                           (root.name == translated_new_install_name() or d.format.exists)):
                 continue
 
             page = Page(root.name)
-- 
1.8.5.3



More information about the anaconda-patches mailing list