diff --git a/fasta_checksum_utils/_contig.py b/fasta_checksum_utils/_contig.py index d907972..e214a8a 100644 --- a/fasta_checksum_utils/_contig.py +++ b/fasta_checksum_utils/_contig.py @@ -1,3 +1,4 @@ +import asyncio import pysam from typing import Generator from .algorithms import ChecksumAlgorithm @@ -23,8 +24,4 @@ def gen_sequence() -> Generator[bytes, None, None]: .encode("ascii") ) - r = [] - for a in algorithms: - r.append(await a.checksum_sequence(gen_sequence())) - - return tuple(r) + return tuple(await asyncio.gather(*(a.checksum_sequence(gen_sequence()) for a in algorithms)))