refactor: replace verbose checks with String.IsNullOrEmpty where applicable.

Thanks to Kira for this patch from http://opensimulator.org/mantis/view.php?id=6845
This commit is contained in:
Justin Clark-Casey (justincc)
2013-11-15 21:45:08 +00:00
parent b4932bda2a
commit 7cab41f422
30 changed files with 46 additions and 47 deletions

View File

@@ -367,7 +367,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
Vector3 ZeroVector = new Vector3(0, 0, 0);
bool nameSearch = (ts.name != null && ts.name != "");
bool nameSearch = !string.IsNullOrEmpty(ts.name);
foreach (EntityBase ent in Entities)
{
@@ -605,7 +605,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
return sensedEntities;
senseEntity(sp);
}
else if (ts.name != null && ts.name != "")
else if (!string.IsNullOrEmpty(ts.name))
{
ScenePresence sp;
// Try lookup by name will return if/when found

View File

@@ -618,7 +618,7 @@ namespace SecondLife
// error log.
if (results.Errors.Count > 0)
{
if (!retried && (results.Errors[0].FileName == null || results.Errors[0].FileName == String.Empty) &&
if (!retried && string.IsNullOrEmpty(results.Errors[0].FileName) &&
results.Errors[0].Line == 0)
{
// System.Console.WriteLine("retrying failed compilation");