mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
reduce potencial useless string casts from list items
This commit is contained in:
@@ -1355,10 +1355,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
return "";
|
||||
}
|
||||
drawList += "FillPolygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0);
|
||||
drawList += "FillPolygon " + x.GetStringItem(0) + "," + y.GetStringItem(0);
|
||||
for (int i = 1; i < x.Length; i++)
|
||||
{
|
||||
drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i);
|
||||
drawList += "," + x.GetStringItem(i) + "," + y.GetStringItem(i);
|
||||
}
|
||||
drawList += "; ";
|
||||
return drawList;
|
||||
@@ -1372,10 +1372,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
return "";
|
||||
}
|
||||
drawList += "Polygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0);
|
||||
drawList += "Polygon " + x.GetStringItem(0) + "," + y.GetStringItem(0);
|
||||
for (int i = 1; i < x.Length; i++)
|
||||
{
|
||||
drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i);
|
||||
drawList += "," + x.GetStringItem(i) + "," + y.GetStringItem(i);
|
||||
}
|
||||
drawList += "; ";
|
||||
return drawList;
|
||||
@@ -1767,7 +1767,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
for (int idx = 0; idx < rules.Length;)
|
||||
{
|
||||
int code = rules.GetLSLIntegerItem(idx++);
|
||||
string arg = rules.GetLSLStringItem(idx++);
|
||||
string arg = rules.GetStringItem(idx++);
|
||||
switch (code)
|
||||
{
|
||||
case ScriptBaseClass.PARCEL_DETAILS_NAME:
|
||||
@@ -2163,7 +2163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
StringBuilder notecardData = new();
|
||||
|
||||
for (int i = 0; i < contents.Length; i++)
|
||||
notecardData.Append((string)(contents.GetLSLStringItem(i) + "\n"));
|
||||
notecardData.Append(contents.GetStringItem(i) + "\n");
|
||||
|
||||
SaveNotecard(notecardName, "Script generated notecard", notecardData.ToString(), false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user