@@ -922,8 +922,7 @@ def compare(self, a, b):
922922 else :
923923 raise ValueError ('unknown tag %r' % (tag ,))
924924
925- for line in g :
926- yield line
925+ yield from g
927926
928927 def _dump (self , tag , x , lo , hi ):
929928 """Generate comparison results for a same-tagged range."""
@@ -942,8 +941,7 @@ def _plain_replace(self, a, alo, ahi, b, blo, bhi):
942941 second = self ._dump ('+' , b , blo , bhi )
943942
944943 for g in first , second :
945- for line in g :
946- yield line
944+ yield from g
947945
948946 def _fancy_replace (self , a , alo , ahi , b , blo , bhi ):
949947 r"""
@@ -997,8 +995,7 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
997995 # no non-identical "pretty close" pair
998996 if eqi is None :
999997 # no identical pair either -- treat it as a straight replace
1000- for line in self ._plain_replace (a , alo , ahi , b , blo , bhi ):
1001- yield line
998+ yield from self ._plain_replace (a , alo , ahi , b , blo , bhi )
1002999 return
10031000 # no close pair, but an identical pair -- synch up on that
10041001 best_i , best_j , best_ratio = eqi , eqj , 1.0
@@ -1010,8 +1007,7 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
10101007 # identical
10111008
10121009 # pump out diffs from before the synch point
1013- for line in self ._fancy_helper (a , alo , best_i , b , blo , best_j ):
1014- yield line
1010+ yield from self ._fancy_helper (a , alo , best_i , b , blo , best_j )
10151011
10161012 # do intraline marking on the synch pair
10171013 aelt , belt = a [best_i ], b [best_j ]
@@ -1033,15 +1029,13 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
10331029 btags += ' ' * lb
10341030 else :
10351031 raise ValueError ('unknown tag %r' % (tag ,))
1036- for line in self ._qformat (aelt , belt , atags , btags ):
1037- yield line
1032+ yield from self ._qformat (aelt , belt , atags , btags )
10381033 else :
10391034 # the synch pair is identical
10401035 yield ' ' + aelt
10411036
10421037 # pump out diffs from after the synch point
1043- for line in self ._fancy_helper (a , best_i + 1 , ahi , b , best_j + 1 , bhi ):
1044- yield line
1038+ yield from self ._fancy_helper (a , best_i + 1 , ahi , b , best_j + 1 , bhi )
10451039
10461040 def _fancy_helper (self , a , alo , ahi , b , blo , bhi ):
10471041 g = []
@@ -1053,8 +1047,7 @@ def _fancy_helper(self, a, alo, ahi, b, blo, bhi):
10531047 elif blo < bhi :
10541048 g = self ._dump ('+' , b , blo , bhi )
10551049
1056- for line in g :
1057- yield line
1050+ yield from g
10581051
10591052 def _qformat (self , aline , bline , atags , btags ):
10601053 r"""
0 commit comments