mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 04:02:41 +00:00
(cherry picked from commit 9fb4c2b3c7)
This commit is contained in:
@@ -1577,6 +1577,7 @@ proc genArrToSeq(p: BProc, n: PNode, d: var TLoc) =
|
||||
return
|
||||
if d.k == locNone:
|
||||
getTemp(p, n.typ, d)
|
||||
initLocExpr(p, n[1], a)
|
||||
# generate call to newSeq before adding the elements per hand:
|
||||
let L = toInt(lengthOrd(p.config, n[1].typ))
|
||||
if optSeqDestructors in p.config.globalOptions:
|
||||
@@ -1586,7 +1587,6 @@ proc genArrToSeq(p: BProc, n: PNode, d: var TLoc) =
|
||||
getSeqPayloadType(p.module, seqtype)])
|
||||
else:
|
||||
genNewSeqAux(p, d, intLiteral(L), L == 0)
|
||||
initLocExpr(p, n[1], a)
|
||||
# bug #5007; do not produce excessive C source code:
|
||||
if L < 10:
|
||||
for i in 0..<L:
|
||||
|
||||
Reference in New Issue
Block a user