diff --git a/toolz/itertoolz.py b/toolz/itertoolz.py index 89931ae5..05803b80 100644 --- a/toolz/itertoolz.py +++ b/toolz/itertoolz.py @@ -148,8 +148,7 @@ def _merge_sorted_binary(seqs): try: val2 = next(seq2) except StopIteration: - for val1 in seq1: - yield val1 + yield from seq1 return for val1 in seq1: @@ -167,12 +166,10 @@ def _merge_sorted_binary(seqs): yield val1 else: yield val2 - for val2 in seq2: - yield val2 + yield from seq2 return yield val1 - for val1 in seq1: - yield val1 + yield from seq1 def _merge_sorted_binary_key(seqs, key): @@ -191,8 +188,7 @@ def _merge_sorted_binary_key(seqs, key): try: val2 = next(seq2) except StopIteration: - for val1 in seq1: - yield val1 + yield from seq1 return key2 = key(val2) @@ -213,12 +209,10 @@ def _merge_sorted_binary_key(seqs, key): yield val1 else: yield val2 - for val2 in seq2: - yield val2 + yield from seq2 return yield val1 - for val1 in seq1: - yield val1 + yield from seq1 def interleave(seqs):