diff options
author | Alan M Webb | 2009-09-29 07:10:54 -0400 |
---|---|---|
committer | dr scofield (aka dirk husemann) | 2009-09-29 15:40:41 +0200 |
commit | a43706862c13944c92b3762ed8742415a0363275 (patch) | |
tree | bfbbe1d6ebd9fa4d3c289acb831351af762e3ca8 /OpenSim | |
parent | Remove empty CheckSumServer.cs file. (diff) | |
download | opensim-SC-a43706862c13944c92b3762ed8742415a0363275.zip opensim-SC-a43706862c13944c92b3762ed8742415a0363275.tar.gz opensim-SC-a43706862c13944c92b3762ed8742415a0363275.tar.bz2 opensim-SC-a43706862c13944c92b3762ed8742415a0363275.tar.xz |
Given the perverse way that strided works, if
there is only one element in the range, it must
also coincide with the specified stride. The
existing code assumes that the stride starts at
start ( which is the expected and most useful
behavior).
Signed-off-by: dr scofield (aka dirk husemann) <drscofield@xyzzyxyzzy.net>
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1ebe24e..0bd6546 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4999,6 +4999,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4999 | if (end > src.Length) | 4999 | if (end > src.Length) |
5000 | end = src.Length; | 5000 | end = src.Length; |
5001 | 5001 | ||
5002 | if (stride == 0) | ||
5003 | stride = 1; | ||
5004 | |||
5002 | // There may be one or two ranges to be considered | 5005 | // There may be one or two ranges to be considered |
5003 | 5006 | ||
5004 | if (start != end) | 5007 | if (start != end) |
@@ -5025,9 +5028,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5025 | // A negative stride reverses the direction of the | 5028 | // A negative stride reverses the direction of the |
5026 | // scan producing an inverted list as a result. | 5029 | // scan producing an inverted list as a result. |
5027 | 5030 | ||
5028 | if (stride == 0) | ||
5029 | stride = 1; | ||
5030 | |||
5031 | if (stride > 0) | 5031 | if (stride > 0) |
5032 | { | 5032 | { |
5033 | for (int i = 0; i < src.Length; i += stride) | 5033 | for (int i = 0; i < src.Length; i += stride) |
@@ -5051,7 +5051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5051 | } | 5051 | } |
5052 | else | 5052 | else |
5053 | { | 5053 | { |
5054 | result.Add(src.Data[start]); | 5054 | if (start%stride == 0) |
5055 | { | ||
5056 | result.Add(src.Data[start]); | ||
5057 | } | ||
5055 | } | 5058 | } |
5056 | 5059 | ||
5057 | return result; | 5060 | return result; |