diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-08-10 02:57:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 20:57:13 +0200 |
commit | 91c32218559924ef4f74302310e9195773183f79 (patch) | |
tree | f189fe41f98673308debe617b742367e7ba9ee3a /compiler | |
parent | 46e94c83d451895ead4f51686f614d8c9b1e384c (diff) | |
download | Nim-91c32218559924ef4f74302310e9195773183f79.tar.gz |
simplify isAtom condition (#22430)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgexprs.nim | 5 | ||||
-rw-r--r-- | compiler/jsgen.nim | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index f1de6f757..46a353dce 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -1152,10 +1152,7 @@ proc isSimpleExpr(n: PNode): bool = if n[i].kind notin {nkCommentStmt, nkEmpty}: return false result = isSimpleExpr(n.lastSon) else: - if n.isAtom: - result = true - else: - result = false + result = n.isAtom proc genAndOr(p: BProc, e: PNode, d: var TLoc, m: TMagic) = # how to generate code? diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 1a3154753..8659d511b 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -348,10 +348,7 @@ proc isSimpleExpr(p: PProc; n: PNode): bool = if n[i].kind notin {nkCommentStmt, nkEmpty}: return false result = isSimpleExpr(p, n.lastSon) else: - if n.isAtom: - result = true - else: - result = false + result = n.isAtom proc getTemp(p: PProc, defineInLocals: bool = true): Rope = inc(p.unique) |