[diffoscope] 05/05: difference: too much FP for me, use a loop rather than recursion
Ximin Luo
infinity0 at debian.org
Mon Jun 26 19:32:38 CEST 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch WIP/humungous-diffs
in repository diffoscope.
commit 885cc18e8939d7c487b3da74a795fb4761f4fb1b
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 bff6c28..30db2f9 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, val) if yield_score else top)
for d in top._details:
heapq.heappush(queue, (scorer(d, val), d))
- yield from self.traverse_heapq(scorer, yield_score, 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