[diffoscope] 01/02: difference: too much FP for me, use a loop rather than recursion

Ximin Luo infinity0 at debian.org
Fri Jun 30 17:35:57 CEST 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository diffoscope.

commit 07297e673712f20da3e24e296d2d796ac5c60980
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Jun 26 19:31:52 2017 +0200

    difference: too much FP for me, use a loop rather than recursion
---
 diffoscope/difference.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/diffoscope/difference.py b/diffoscope/difference.py
index 54cb686..9ded2d1 100644
--- a/diffoscope/difference.py
+++ b/diffoscope/difference.py
@@ -146,12 +146,11 @@ class Difference(object):
         return the score of the input node.
         """
         queue = queue if queue is not None else [(scorer(self, None), self)]
-        if queue:
+        while queue:
             val, top = heapq.heappop(queue)
             yield top
             for d in top._details:
                 heapq.heappush(queue, (scorer(d, val), d))
-            yield from self.traverse_heapq(scorer, queue)
 
     @staticmethod
     def from_feeder(feeder1, feeder2, path1, path2, source=None, comment=None, **kwargs):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list