Pārlūkot izejas kodu

Remove useless file open/close.

Jelmer Vernooij 16 gadi atpakaļ
vecāks
revīzija
f651379a07
1 mainītis faili ar 1 papildinājumiem un 5 dzēšanām
  1. 1 5
      dulwich/pack.py

+ 1 - 5
dulwich/pack.py

@@ -229,11 +229,7 @@ class PackIndex(object):
         return self.calculate_checksum() == self.get_stored_checksum()
         return self.calculate_checksum() == self.get_stored_checksum()
   
   
     def calculate_checksum(self):
     def calculate_checksum(self):
-        f = open(self._filename, 'r')
-        try:
-            return make_sha(self._contents[:-20]).digest()
-        finally:
-            f.close()
+        return make_sha(self._contents[:-20]).digest()
 
 
     def get_pack_checksum(self):
     def get_pack_checksum(self):
         """Return the SHA1 checksum stored for the corresponding packfile."""
         """Return the SHA1 checksum stored for the corresponding packfile."""