Remove unnecessary result initialisations.
This commit is contained in:
parent
ef0d1561d4
commit
c23a3e1f84
1 changed files with 1 additions and 2 deletions
|
|
@ -27,7 +27,6 @@ proc cyclicTree*(n: PNode): bool =
|
||||||
cyclicTreeAux(n, visited)
|
cyclicTreeAux(n, visited)
|
||||||
|
|
||||||
proc exprStructuralEquivalent*(a, b: PNode; strictSymEquality=false): bool =
|
proc exprStructuralEquivalent*(a, b: PNode; strictSymEquality=false): bool =
|
||||||
result = false
|
|
||||||
if a == b:
|
if a == b:
|
||||||
result = true
|
result = true
|
||||||
elif (a != nil) and (b != nil) and (a.kind == b.kind):
|
elif (a != nil) and (b != nil) and (a.kind == b.kind):
|
||||||
|
|
@ -51,7 +50,6 @@ proc exprStructuralEquivalent*(a, b: PNode; strictSymEquality=false): bool =
|
||||||
result = true
|
result = true
|
||||||
|
|
||||||
proc sameTree*(a, b: PNode): bool =
|
proc sameTree*(a, b: PNode): bool =
|
||||||
result = false
|
|
||||||
if a == b:
|
if a == b:
|
||||||
result = true
|
result = true
|
||||||
elif a != nil and b != nil and a.kind == b.kind:
|
elif a != nil and b != nil and a.kind == b.kind:
|
||||||
|
|
@ -83,6 +81,7 @@ proc getMagic*(op: PNode): TMagic =
|
||||||
else: result = mNone
|
else: result = mNone
|
||||||
|
|
||||||
proc isConstExpr*(n: PNode): bool =
|
proc isConstExpr*(n: PNode): bool =
|
||||||
|
const constKinds = {nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit, nkFloatLit..nkFloat64Lit, nkNilLit}
|
||||||
result = (n.kind in
|
result = (n.kind in
|
||||||
{nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit,
|
{nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit,
|
||||||
nkFloatLit..nkFloat64Lit, nkNilLit}) or (nfAllConst in n.flags)
|
nkFloatLit..nkFloat64Lit, nkNilLit}) or (nfAllConst in n.flags)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue