aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Yakimowich-Payne <jyapayne@gmail.com>2020-05-13 22:36:40 -0600
committergenotrance <dev@genotrance.com>2020-05-15 11:20:00 -0500
commitfaab2924c8a6a48df65a4ee74363eb822c2c768f (patch)
treee8f4d4f21609ffeb799bd8a5f2104cb0cdfcb5c9
parent2098f6a471784b5c87c678ec9d79faf2cc467199 (diff)
downloadnimterop-faab2924c8a6a48df65a4ee74363eb822c2c768f.tar.gz
nimterop-faab2924c8a6a48df65a4ee74363eb822c2c768f.zip
Cleanup code
-rw-r--r--nimterop/ast2.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/nimterop/ast2.nim b/nimterop/ast2.nim
index 389d371..dff355e 100644
--- a/nimterop/ast2.nim
+++ b/nimterop/ast2.nim
@@ -949,10 +949,9 @@ proc getTypeArray(gState: State, node: TSNode, tident: PNode, name: string): PNo
for i in 0 ..< acount:
if cnode.len == 2:
# type name[X] => array[X, type]
- var size: PNode
- let cnodeVal = gState.getNodeVal(cnode[1])
- # Size of array could be a Nim expression
- size = gState.parseCExpression(cnodeVal, skipIdentValidation = true)
+ let
+ # Size of array could be a Nim expression
+ size = gState.parseCExpression(gState.getNodeVal(cnode[1]), skipIdentValidation = true)
result = gState.newArrayTree(cnode, result, size)
cnode = cnode[0]