Permalink
Browse files

Fixed edge case where all inputs are empty, simplified logic

  • Loading branch information...
1 parent 2de70ce commit d7563dc80a1ef645e1c22a860183ec3472c835ec Ben Weisburd committed with casbon Feb 6, 2014
Showing with 1 addition and 4 deletions.
  1. +1 −4 vcf/utils.py
View
@@ -33,7 +33,7 @@ def walk_together(*readers, **kwargs):
nexts.append(None)
min_k = (None,) # keep track of the previous min key's contig
- while True:
+ while any([r is not None for r in nexts]):
next_idx_to_k = dict(
(i, get_key(r)) for i, r in enumerate(nexts) if r is not None)
keys_with_prev_contig = [
@@ -52,9 +52,6 @@ def walk_together(*readers, **kwargs):
nexts[i] = readers[i].next()
except StopIteration:
nexts[i] = None
-
- if all([r is None for r in nexts]):
- break
def trim_common_suffix(*sequences):

0 comments on commit d7563dc

Please sign in to comment.