OSDN Git Service

Some code refactoring.
authorLoRd_MuldeR <mulder2@gmx.de>
Tue, 4 Jul 2017 20:01:14 +0000 (22:01 +0200)
committerLoRd_MuldeR <mulder2@gmx.de>
Tue, 4 Jul 2017 20:01:14 +0000 (22:01 +0200)
bindings/Python/library/MHashPy384.py

index 6a59eab..b4df841 100644 (file)
@@ -1304,10 +1304,9 @@ class MHash384:
     def __update(self, input):
         xor = self.__class__.__TABLE_XOR[input]
         mix = self.__class__.__TABLE_MIX[self.__rnd]
-        for i in range(len( self.__digest)):
-            tmp = self.__digest[mix[i]];
-            self.__digest[mix[i]] = self.__digest[i];
-            self.__digest[i] = tmp ^ xor[i];
+        for i in range(len(self.__digest)):
+            self.__digest[mix[i]], self.__digest[i] = \
+                self.__digest[i], self.__digest[mix[i]] ^ xor[i]
         self.__rnd = (self.__rnd + 1) % len(self.__class__.__TABLE_MIX)
 
     #------------------------------------------------------------------------