== string.Empty is .Lenght == 0

This commit is contained in:
UbitUmarov
2022-01-13 20:31:52 +00:00
parent 6595e3ae26
commit fbbcc1edd7
149 changed files with 261 additions and 264 deletions

View File

@@ -660,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
catch (Exception e)
{
m_log.Error(string.Format("[ARCHIVER]: Error closing archive: {0} ", e.Message), e);
if (errorMessage == string.Empty)
if (errorMessage.Length == 0)
errorMessage = e.Message;
}

View File

@@ -1863,7 +1863,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
this.Scene.RegionInfo.RegionSettings;
SceneObjectGroup telehub = null;
if (settings.TelehubObject != UUID.Zero &&
if (!settings.TelehubObject.IsZero() &&
(telehub = Scene.GetSceneObjectGroup(settings.TelehubObject)) != null)
{
List<Vector3> spawnPoints = new List<Vector3>();

View File

@@ -345,7 +345,7 @@ namespace OpenSim.Region.CoreModules.World.Region
protected void CreateMarkerFile()
{
if (m_MarkerPath == String.Empty)
if (m_MarkerPath.Length == 0)
return;
string path = Path.Combine(m_MarkerPath, m_Scene.RegionInfo.RegionID.ToString());

View File

@@ -51,9 +51,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.bevel == "taper")
{
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = String.Format("Noise strength must be 0.0 to 1.0: {0}", data.elevation);
}
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,9 +49,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = this.parseParameters(args, out data);
// Context-specific validation
if (result == String.Empty)
if (result.Length == 0)
{
if (data.bevel == "taper")
{
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
result = String.Format("Smoothing strength must be 0.0 to 1.0: {0}", data.elevation);
}
if (data.shape == String.Empty)
if (data.shape.Length == 0)
{
data.shape = "rectangle";
data.x0 = 0;
@@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Modifiers
}
// if it's all good, then do the work
if (result == String.Empty)
if (result.Length == 0)
{
this.applyModification(map, data);
}

View File

@@ -66,10 +66,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
{
result = this.parseFloat(args[3], out data.elevation);
}
if (result == String.Empty)
if (result.Length == 0)
{
int index = 3;
while(++index < args.Length && result == String.Empty)
while(++index < args.Length && result.Length == 0)
{
arg = args[index];
// check for shape
@@ -91,15 +91,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain
else
{
result = this.parseInt(coords[0], out data.x0);
if (result == String.Empty)
if (result.Length == 0)
{
result = this.parseInt(coords[1], out data.y0);
}
if (result == String.Empty)
if (result.Length == 0)
{
result = this.parseInt(coords[2], out data.dx);
}
if (result == String.Empty)
if (result.Length == 0)
{
if (coords.Length == 4)
{
@@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
data.dy = data.dx;
}
}
if (result == String.Empty)
if (result.Length == 0)
{
if ((data.dx <= 0) || (data.dy <= 0))
{

View File

@@ -2026,7 +2026,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
result = operation.ModifyTerrain(m_channel, cmd);
}
if (result == String.Empty)
if (result.Length == 0)
{
result = "Modified terrain";
m_log.DebugFormat("Performed terrain operation {0}", operationType);