diff options
author | idb | 2009-01-20 00:10:39 +0000 |
---|---|---|
committer | idb | 2009-01-20 00:10:39 +0000 |
commit | afc48ce39cce1054b20a319de965c583d7aa2c07 (patch) | |
tree | 5a2c9e6af44a6593e782601411a63fe36380bf7b | |
parent | oops hash codes can be negative, account for that (diff) | |
download | opensim-SC-afc48ce39cce1054b20a319de965c583d7aa2c07.zip opensim-SC-afc48ce39cce1054b20a319de965c583d7aa2c07.tar.gz opensim-SC-afc48ce39cce1054b20a319de965c583d7aa2c07.tar.bz2 opensim-SC-afc48ce39cce1054b20a319de965c583d7aa2c07.tar.xz |
Added overrides for == and != for list.
Fixes Mantis #3002
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 24 |
1 files changed, 24 insertions, 0 deletions
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 | |||
538 | return a; | 538 | return a; |
539 | } | 539 | } |
540 | 540 | ||
541 | public static bool operator ==(list a, list b) | ||
542 | { | ||
543 | int la = -1; | ||
544 | int lb = -1; | ||
545 | try { la = a.Length; } | ||
546 | catch (NullReferenceException) { } | ||
547 | try { lb = b.Length; } | ||
548 | catch (NullReferenceException) { } | ||
549 | |||
550 | return la == lb; | ||
551 | } | ||
552 | |||
553 | public static bool operator !=(list a, list b) | ||
554 | { | ||
555 | int la = -1; | ||
556 | int lb = -1; | ||
557 | try { la = a.Length; } | ||
558 | catch (NullReferenceException) { } | ||
559 | try {lb = b.Length;} | ||
560 | catch (NullReferenceException) { } | ||
561 | |||
562 | return la != lb; | ||
563 | } | ||
564 | |||
541 | public void Add(object o) | 565 | public void Add(object o) |
542 | { | 566 | { |
543 | object[] tmp; | 567 | object[] tmp; |