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 +++------ .../ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'OpenSim') 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 - } } /// diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs index a7ca18c..a44b545 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs @@ -34,7 +34,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools 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.Shared.CodeTools 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.Shared.CodeTools 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