simplify isAtom condition (#22430)

This commit is contained in:
ringabout
2023-08-10 02:57:13 +08:00
committed by GitHub
parent 46e94c83d4
commit 91c3221855
2 changed files with 2 additions and 8 deletions

View File

@@ -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?

View File

@@ -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)