From 7cab41f4223b7febd3fdd42fa7cfefef25e4a9c9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Nov 2013 21:45:08 +0000 Subject: refactor: replace verbose checks with String.IsNullOrEmpty where applicable. Thanks to Kira for this patch from http://opensimulator.org/mantis/view.php?id=6845 --- .../ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 4 ++-- OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 6e74227..64dc2e2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -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 diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 87f7189..a1b8d85 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -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"); -- cgit v1.1