mirror of
https://github.com/opensim/opensim.git
synced 2026-05-13 18:21:49 +08:00
ugly cosmetics
This commit is contained in:
@@ -6558,15 +6558,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// The index number of the point in src where test was found if it was found.
|
||||
/// Otherwise returns -1
|
||||
/// </returns>
|
||||
public LSL_Integer llListFindList(LSL_List src, LSL_List test)
|
||||
public LSL_Integer llListFindList(LSL_List lsrc, LSL_List ltest)
|
||||
{
|
||||
if (src.Length == 0)
|
||||
if (lsrc.Length == 0)
|
||||
return -1;
|
||||
if (test.Length == 0)
|
||||
if (ltest.Length == 0)
|
||||
return 0;
|
||||
if (test.Length > src.Length)
|
||||
if (ltest.Length > lsrc.Length)
|
||||
return -1;
|
||||
|
||||
object[] src = lsrc.Data;
|
||||
object[] test = ltest.Data;
|
||||
|
||||
object test0 = test[0];
|
||||
for (int i = 0; i <= src.Length - test.Length; i++)
|
||||
{
|
||||
@@ -6589,24 +6592,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return -1;
|
||||
}
|
||||
|
||||
public LSL_Integer llListFindListNext(LSL_List src, LSL_List test, LSL_Integer linstance)
|
||||
public LSL_Integer llListFindListNext(LSL_List lsrc, LSL_List ltest, LSL_Integer linstance)
|
||||
{
|
||||
if (src.Length == 0)
|
||||
return test.Length == 0 ? 0 : -1;
|
||||
if (lsrc.Length == 0)
|
||||
return ltest.Length == 0 ? 0 : -1;
|
||||
|
||||
int instance = linstance.value;
|
||||
if (test.Length == 0)
|
||||
if (ltest.Length == 0)
|
||||
{
|
||||
if(instance >= 0)
|
||||
return instance < src.Length ? instance : -1;
|
||||
return instance < lsrc.Length ? instance : -1;
|
||||
|
||||
instance += src.Length;
|
||||
instance += lsrc.Length;
|
||||
return instance >= 0 ? instance : -1;
|
||||
}
|
||||
|
||||
if (test.Length > src.Length)
|
||||
if (ltest.Length > lsrc.Length)
|
||||
return -1;
|
||||
|
||||
object[] src = lsrc.Data;
|
||||
object[] test = ltest.Data;
|
||||
|
||||
object test0 = test[0];
|
||||
int nmatchs = 0;
|
||||
|
||||
|
||||
@@ -6640,24 +6640,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return new LSL_Vector(red, green, 1.0f);
|
||||
}
|
||||
|
||||
public LSL_Integer osListFindListNext(LSL_List src, LSL_List test, LSL_Integer lstart, LSL_Integer lend, LSL_Integer linstance)
|
||||
public LSL_Integer osListFindListNext(LSL_List lsrc, LSL_List ltest, LSL_Integer lstart, LSL_Integer lend, LSL_Integer linstance)
|
||||
{
|
||||
if (src.Length == 0)
|
||||
return test.Length == 0 ? 0 : -1;
|
||||
if (lsrc.Length == 0)
|
||||
return ltest.Length == 0 ? 0 : -1;
|
||||
|
||||
int instance = linstance.value;
|
||||
if (test.Length == 0)
|
||||
if (ltest.Length == 0)
|
||||
{
|
||||
if(instance >= 0)
|
||||
return instance < src.Length ? instance : -1;
|
||||
return instance < lsrc.Length ? instance : -1;
|
||||
|
||||
instance += src.Length;
|
||||
instance += lsrc.Length;
|
||||
return instance >= 0 ? instance : -1;
|
||||
}
|
||||
|
||||
if (test.Length > src.Length)
|
||||
if (ltest.Length > lsrc.Length)
|
||||
return -1;
|
||||
|
||||
object[] src = lsrc.Data;
|
||||
object[] test = ltest.Data;
|
||||
|
||||
int start = lstart.value;
|
||||
if (start < 0)
|
||||
{
|
||||
|
||||
@@ -802,6 +802,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public int Length
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
if (m_data is null)
|
||||
@@ -860,12 +861,13 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public object[] Data
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
m_data ??= new object[0];
|
||||
return m_data;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
set { m_data = value; }
|
||||
}
|
||||
|
||||
@@ -878,6 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
/// <param name='itemIndex'></param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Type GetLSLListItemType(int itemIndex)
|
||||
{
|
||||
return Data[itemIndex].GetType();
|
||||
@@ -1105,6 +1108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
Data[itemIndex].GetType().Name : "null"));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public LSL_Types.key GetKeyItem(int itemIndex)
|
||||
{
|
||||
return (LSL_Types.key)Data[itemIndex];
|
||||
@@ -1137,12 +1141,14 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public object this[int i]
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
if(m_data is null || i >= m_data.Length)
|
||||
return null;
|
||||
return m_data[i];
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
set
|
||||
{
|
||||
if (m_data is null || i >= m_data.Length)
|
||||
@@ -1151,6 +1157,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static implicit operator Boolean(list l)
|
||||
{
|
||||
return l.Length != 0;
|
||||
@@ -1174,6 +1181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
return a;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(list a, list b)
|
||||
{
|
||||
if (b is null)
|
||||
@@ -1181,6 +1189,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
return a is not null && a.Length == b.Length;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(list a, list b)
|
||||
{
|
||||
if (b is null)
|
||||
@@ -2233,6 +2242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
if (o is list lo)
|
||||
@@ -2240,6 +2250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
return false;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Data.GetHashCode();
|
||||
|
||||
Reference in New Issue
Block a user