use some shared char arrays on string split

This commit is contained in:
UbitUmarov
2022-10-19 01:38:25 +01:00
parent 11005b24e9
commit fddb3761a0
24 changed files with 105 additions and 101 deletions

View File

@@ -15260,7 +15260,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
private string Name2Username(string name)
{
string[] parts = name.Split(new char[] {' '});
string[] parts = name.Split();
if (parts.Length < 2)
return name.ToLower();
if (parts[1].Equals("Resident"))

View File

@@ -359,7 +359,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
bool error = false;
if (!string.IsNullOrWhiteSpace(ownerPerm))
{
ids = ownerPerm.Split(new char[] {','});
ids = ownerPerm.Split(Util.SplitCommaArray);
foreach (string id in ids)
{
string current = id.Trim();
@@ -415,7 +415,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
error = false;
if (!string.IsNullOrWhiteSpace(creatorPerm))
{
ids = creatorPerm.Split(new char[] {','});
ids = creatorPerm.Split(Util.SplitCommaArray);
foreach (string id in ids)
{
string current = id.Trim();

View File

@@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
{
str = str.Replace('<', ' ');
str = str.Replace('>', ' ');
string[] tmps = str.Split(new Char[] {','});
string[] tmps = str.Split(Util.SplitCommaArray);
if (tmps.Length < 3)
{
z = y = x = 0;
@@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
{
str = str.Replace('<', ' ');
str = str.Replace('>', ' ');
string[] tmps = str.Split(new Char[] {','});
string[] tmps = str.Split(Util.SplitCommaArray);
if (tmps.Length < 4 ||
!Double.TryParse(tmps[3], NumberStyles.Float, Culture.NumberFormatInfo, out s))
{