summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-04-01 16:24:04 +0200
committerAraq <rumpf_a@web.de>2019-04-01 16:24:04 +0200
commitfda1352ccfdf46610cf18fb9cfeefe6d5c85bc5a (patch)
tree2a9314c4befc07080fe2692ad10c1bbb81fcf944 /lib/pure
parentcce8d3da27438a6718c8b0d381ccb296f5e1cd4d (diff)
downloadNim-fda1352ccfdf46610cf18fb9cfeefe6d5c85bc5a.tar.gz
json.nim: tiny refactoring
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/json.nim5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index 5f00602cb..c05bbc588 100644
--- a/lib/pure/json.nim
+++ b/lib/pure/json.nim
@@ -1023,10 +1023,7 @@ proc toIdentNode(typeNode: NimNode): NimNode =
 
 proc createGetEnumCall(jsonNode, kindType: NimNode): NimNode =
   # -> getEnum(`jsonNode`, `kindType`)
-  let getEnumSym = bindSym("getEnum")
-  let astStrLit = toStrLit(jsonNode)
-  let getEnumCall = newCall(getEnumSym, jsonNode, astStrLit, kindType)
-  return getEnumCall
+  result = newCall(bindSym("getEnum"), jsonNode, toStrLit(jsonNode), kindType)
 
 proc createOfBranchCond(ofBranch, getEnumCall: NimNode): NimNode =
   ## Creates an expression that acts as the condition for an ``of`` branch.