Преглед изворни кода

refactor _convert_bool_matrix_to_int, make it more elegent

quarrying пре 2 година
родитељ
комит
2143fb2331
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      khandy/image/image_hash.py

+ 1 - 2
khandy/image/image_hash.py

@@ -6,9 +6,8 @@ import numpy as np
 def _convert_bool_matrix_to_int(bool_mat):
     hash_val = int(0)
     for item in bool_mat.flatten():
-        hash_val |= int(item)
         hash_val <<= 1
-    hash_val >>= 1
+        hash_val |= int(item)
     return hash_val