From afc48ce39cce1054b20a319de965c583d7aa2c07 Mon Sep 17 00:00:00 2001 From: idb Date: Tue, 20 Jan 2009 00:10:39 +0000 Subject: Added overrides for == and != for list. Fixes Mantis #3002 --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 2f672e8..7081e5c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -538,6 +538,30 @@ namespace OpenSim.Region.ScriptEngine.Shared return a; } + public static bool operator ==(list a, list b) + { + int la = -1; + int lb = -1; + try { la = a.Length; } + catch (NullReferenceException) { } + try { lb = b.Length; } + catch (NullReferenceException) { } + + return la == lb; + } + + public static bool operator !=(list a, list b) + { + int la = -1; + int lb = -1; + try { la = a.Length; } + catch (NullReferenceException) { } + try {lb = b.Length;} + catch (NullReferenceException) { } + + return la != lb; + } + public void Add(object o) { object[] tmp; -- cgit v1.1