From 9df0000621d528309cdaae67e0d203d9fdff57c3 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Fri, 24 Feb 2017 10:51:54 +0200 Subject: Proper use of sequences in coroutine tests --- tests/coroutines/titerators.nim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/coroutines/titerators.nim') diff --git a/tests/coroutines/titerators.nim b/tests/coroutines/titerators.nim index c263b49db..e2623ce2d 100644 --- a/tests/coroutines/titerators.nim +++ b/tests/coroutines/titerators.nim @@ -3,8 +3,7 @@ include system/timers var stackCheckValue = 1100220033 - numbers = newSeq[int](10) - i = 0 + numbers = newSeqOfCap[int](10) iterator theIterator(id: int, sleep: float): int = for i in 0..<5: @@ -13,8 +12,7 @@ iterator theIterator(id: int, sleep: float): int = proc theCoroutine(id: int, sleep: float32) = for n in theIterator(id, sleep): - numbers[i] = n - inc(i) + numbers.add(n) var start = getTicks() start(proc() = theCoroutine(1, 0.01)) -- cgit 1.4.1-2-gfad0