From 191bee2ed0903b23f5d93f79650daf7662480b17 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 20 Jul 2010 00:55:31 +0200 Subject: Remove the null checks altogether --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 +-------- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 16 ++++------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a947b3d..138bcc9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5027,14 +5027,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - if (src == null) - { - return 0; - } - else - { - return src.Length; - } + return src.Length; } public LSL_Integer llList2Integer(LSL_List src, int index) diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index bab5156..a3a2fdf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -613,24 +613,16 @@ namespace OpenSim.Region.ScriptEngine.Shared public static bool operator ==(list a, list b) { - int la = -1; - int lb = -1; - if (a != null) - la = a.Length; - if (b != null) - lb = b.Length; + int la = a.Length; + int lb = b.Length; return la == lb; } public static bool operator !=(list a, list b) { - int la = -1; - int lb = -1; - if (a != null) - la = a.Length; - if (b != null) - lb = b.Length; + int la = a.Length; + int lb = b.Length; return la != lb; } -- cgit v1.1