[blivet:master 03/20] Do not compare the same two values twice.

mulhern amulhern at redhat.com
Tue Dec 23 23:42:16 UTC 2014


If x and y are Sizes, not (x < y) implies x >= y.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devicelibs/swap.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/blivet/devicelibs/swap.py b/blivet/devicelibs/swap.py
index bcc0308..4e31cdb 100644
--- a/blivet/devicelibs/swap.py
+++ b/blivet/devicelibs/swap.py
@@ -146,10 +146,10 @@ def swapSuggestion(quiet=False, hibernation=False, disk_space=None):
     if mem < two_GiB:
         swap = 2 * mem
 
-    elif two_GiB <= mem < eight_GiB:
+    elif mem < eight_GiB:
         swap = mem
 
-    elif eight_GiB <= mem < sixtyfour_GiB:
+    elif mem < sixtyfour_GiB:
         swap = mem / 2
 
     else:
-- 
1.9.3



More information about the anaconda-patches mailing list