2
0
Эх сурвалжийг харах

pack.PackIndex: de-duplicate __iter__ implementation

The PackIndex class has two __iter__ implementations. Pick the latter
one and remove the earlier one.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Tay Ray Chuan 14 жил өмнө
parent
commit
ae8d2e3201
1 өөрчлөгдсөн 1 нэмэгдсэн , 5 устгасан
  1. 1 5
      dulwich/pack.py

+ 1 - 5
dulwich/pack.py

@@ -243,7 +243,7 @@ class PackIndex(object):
 
     def __iter__(self):
         """Iterate over the SHAs in this pack."""
-        raise NotImplementedError(self.__iter__)
+        return imap(sha_to_hex, self._itersha())
 
     def iterentries(self):
         """Iterate over the entries in this pack index.
@@ -278,10 +278,6 @@ class PackIndex(object):
         """
         raise NotImplementedError(self._object_index)
 
-    def __iter__(self):
-        """Iterate over the SHAs in this pack."""
-        return imap(sha_to_hex, self._itersha())
-
     def objects_sha1(self):
         """Return the hex SHA1 over all the shas of all objects in this pack.