diff options
author | Matthew Baulch <baulch.matt@gmail.com> | 2016-08-27 20:07:10 +1000 |
---|---|---|
committer | Matthew Baulch <baulch.matt@gmail.com> | 2016-08-27 20:07:10 +1000 |
commit | c23a3e1f840285c8e76f0cad379fc52ac59188f9 (patch) | |
tree | 5f24b752338af8da8e9c252e2e01f4384f983e76 | |
parent | ef0d1561d4f1020ef1f5b94f5cc62c0709638add (diff) | |
download | Nim-c23a3e1f840285c8e76f0cad379fc52ac59188f9.tar.gz |
Remove unnecessary result initialisations.
-rw-r--r-- | compiler/trees.nim | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/trees.nim b/compiler/trees.nim index c32782a50..f2d417f72 100644 --- a/compiler/trees.nim +++ b/compiler/trees.nim @@ -27,7 +27,6 @@ proc cyclicTree*(n: PNode): bool = cyclicTreeAux(n, visited) proc exprStructuralEquivalent*(a, b: PNode; strictSymEquality=false): bool = - result = false if a == b: result = true 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 proc sameTree*(a, b: PNode): bool = - result = false if a == b: result = true elif a != nil and b != nil and a.kind == b.kind: @@ -83,6 +81,7 @@ proc getMagic*(op: PNode): TMagic = else: result = mNone proc isConstExpr*(n: PNode): bool = + const constKinds = {nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit, nkFloatLit..nkFloat64Lit, nkNilLit} result = (n.kind in {nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit, nkFloatLit..nkFloat64Lit, nkNilLit}) or (nfAllConst in n.flags) |