From bb777a9c3c6824411b96bd6e14ff8d6325fbda38 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Thu, 24 Jul 2008 05:23:42 +0000 Subject: Replace the try/catch with a null check. --- .../DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs index 16b12c3..8abf3b9 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs @@ -34,7 +34,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL public class LSL2CSCodeTransformer { private SYMBOL m_astRoot = null; - private static Dictionary m_datatypeLSL2OpenSim = new Dictionary(); + private static Dictionary m_datatypeLSL2OpenSim = null; /// /// Pass the new CodeTranformer an abstract syntax tree. @@ -45,8 +45,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL m_astRoot = astRoot; // let's populate the dictionary - try + if (null == m_datatypeLSL2OpenSim) { + m_datatypeLSL2OpenSim = new Dictionary(); m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger"); m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat"); //m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used @@ -56,10 +57,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion"); m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list"); } - catch - { - // temporary workaround since we are adding to a static datatype - } } /// -- cgit v1.1