소스 검색

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 년 전
부모
커밋
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.