diff options
author | Araq <rumpf_a@web.de> | 2014-05-30 13:15:54 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-05-30 13:15:54 +0200 |
commit | ea16aca09ec47e3d4393437dea4f398922acaba0 (patch) | |
tree | 4c53b3178710a6afd6ad3a533f136116de1afcfd /tests/parallel | |
parent | 6470bd8f87b860c555556a2a965f6c8077e993ad (diff) | |
download | Nim-ea16aca09ec47e3d4393437dea4f398922acaba0.tar.gz |
correct code generation for tforstmt
Diffstat (limited to 'tests/parallel')
-rw-r--r-- | tests/parallel/tforstmt.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/parallel/tforstmt.nim b/tests/parallel/tforstmt.nim index 35f28759e..58de833f3 100644 --- a/tests/parallel/tforstmt.nim +++ b/tests/parallel/tforstmt.nim @@ -7,14 +7,15 @@ discard """ sortoutput: true """ -import threadpool, math +import threadpool, os proc p(x: int) = + os.sleep(100 - x*10) echo x proc testFor(a, b: int; foo: var openArray[int]) = parallel: - for i in max(a, 0) .. min(b, foo.len-1): + for i in max(a, 0) .. min(b, foo.high): spawn p(foo[i]) var arr = [0, 1, 2, 3, 4, 5, 6, 7] |