refactoring, fixes yet another strictFuncs regression (#15446)

This commit is contained in:
Andreas Rumpf
2020-10-01 11:16:04 +02:00
committed by GitHub
parent b703f02ad2
commit 2b91845f1d
3 changed files with 34 additions and 8 deletions

View File

@@ -0,0 +1,17 @@
discard """
cmd: "nim c --experimental:strictFuncs $file"
"""
import tables, streams, nre, parsecsv
type
Contig2Reads = TableRef[string, seq[string]]
proc get_Contig2Reads(sin: Stream, fn: string, contig2len: TableRef[string, int]): Contig2Reads =
result = newTable[string, seq[string]]()
var parser: CsvParser
open(parser, sin, filename = fn, separator = ' ', skipInitialSpace = true)
while readRow(parser, 2):
if contig2len.haskey(parser.row[1]):
mgetOrPut(result, parser.row[1], @[]).add(parser.row[0])