From de28ee84f906a55a6e6032a77c8ee4ca60001e77 Mon Sep 17 00:00:00 2001 From: arookas Date: Mon, 28 Dec 2015 01:22:54 -0500 Subject: [PATCH] Refactored declaration code. --- ssc/scope stack.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ssc/scope stack.cs b/ssc/scope stack.cs index 4711541..c44240d 100644 --- a/ssc/scope stack.cs +++ b/ssc/scope stack.cs @@ -57,21 +57,11 @@ namespace arookas } sunVariableSymbol DeclareGlobal(string name) { - var variableInfo = Top.DeclareVariable(name, 0, GlobalCount); - if (variableInfo == null) - { - return null; - } - return variableInfo; + return Top.DeclareVariable(name, 0, GlobalCount); } sunVariableSymbol DeclareLocal(string name) { - var variableInfo = Top.DeclareVariable(name, 1, LocalCount); - if (variableInfo == null) - { - return null; - } - return variableInfo; + return Top.DeclareVariable(name, 1, LocalCount); } public IEnumerator GetEnumerator() { return Stack.GetEnumerator(); }