skip exclusive branch
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 16 Apr 2020 08:10:01 +0000 (10:10 +0200)
committerPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 16 Apr 2020 08:10:06 +0000 (10:10 +0200)
Of the two conditions only one can ever apply, so skip evaluating
the second one if the first branch was taken.

deltatar/crypto.py

index d18d406..c3f8e32 100755 (executable)
@@ -826,7 +826,7 @@ def kdf_by_version (paramversion=None, defs=None):
     (kdf, params) = defs["kdf"]
     fn = None
     if kdf == "scrypt" : fn = kdf_scrypt
-    if kdf == "dummy"  : fn = kdf_dummy
+    elif kdf == "dummy"  : fn = kdf_dummy
     if fn is None:
         raise ValueError ("key derivation method %r unknown" % kdf)
     return partial (fn, params)