minor: reuse colon index calculation in XEngine.OnRezScript. The index if a colon is found on the first line will always be the same as for the whole script.
parent
bb48060b44
commit
f9769a9fcb
|
@ -768,12 +768,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
int colon = firstline.IndexOf(':');
|
int colon = firstline.IndexOf(':');
|
||||||
if (firstline.Length > 2 && firstline.Substring(0, 2) == "//" && colon != -1)
|
if (firstline.Length > 2 && firstline.Substring(0, 2) == "//" && colon != -1)
|
||||||
{
|
{
|
||||||
string engineName = firstline.Substring(2, colon-2);
|
string engineName = firstline.Substring(2, colon - 2);
|
||||||
|
|
||||||
if (names.Contains(engineName))
|
if (names.Contains(engineName))
|
||||||
{
|
{
|
||||||
engine = engineName;
|
engine = engineName;
|
||||||
script = "//" + script.Substring(script.IndexOf(':')+1);
|
script = "//" + script.Substring(colon + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue