fix #14655 setLen(seq) now zeros memory (#14656)

* simplify sysstr.nim

* fix #14655
This commit is contained in:
Timothee Cour 2020-06-14 02:11:26 -07:00 • committed by GitHub
commit 0fc5d3f13b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions

View file

@ -206,4 +206,11 @@ block ttoseq:
stdout.write("\n")
block tseqmapitchain:
doAssert @[101, 102] == [1, 2].mapIt(func (x: int): int = it + x).mapIt(it(100))
doAssert @[101, 102] == [1, 2].mapIt(func (x: int): int = it + x).mapIt(it(100))
for i in 0..100:
# fix #14655
var test = newSeqOfCap[uint32](1)
test.setLen(1)
doAssert test[0] == 0, $(test[0], i)