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 --- .../Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | 6 +++--- .../Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | 4 ++-- OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules/Scripting') diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 1a62405..c3a8afd 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -460,9 +460,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest Request.Headers.Add(HttpCustomHeaders[i], HttpCustomHeaders[i+1]); } - if (proxyurl != null && proxyurl.Length > 0) + if (!string.IsNullOrEmpty(proxyurl)) { - if (proxyexcepts != null && proxyexcepts.Length > 0) + if (!string.IsNullOrEmpty(proxyexcepts)) { string[] elist = proxyexcepts.Split(';'); Request.Proxy = new WebProxy(proxyurl, true, elist); @@ -483,7 +483,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest } // Encode outbound data - if (OutboundBody != null && OutboundBody.Length > 0) + if (!string.IsNullOrEmpty(OutboundBody)) { byte[] data = Util.UTF8.GetBytes(OutboundBody); diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index 65737fa..baf9f2f 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -161,9 +161,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL { WebRequest request = HttpWebRequest.Create(url); - if (m_proxyurl != null && m_proxyurl.Length > 0) + if (!string.IsNullOrEmpty(m_proxyurl)) { - if (m_proxyexcepts != null && m_proxyexcepts.Length > 0) + if (!string.IsNullOrEmpty(m_proxyexcepts)) { string[] elist = m_proxyexcepts.Split(';'); request.Proxy = new WebProxy(m_proxyurl, true, elist); diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index cbffca7..c6e05b1 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -677,7 +677,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC // if not, use as method name UUID parseUID; string mName = "llRemoteData"; - if ((Channel != null) && (Channel != "")) + if (!string.IsNullOrEmpty(Channel)) if (!UUID.TryParse(Channel, out parseUID)) mName = Channel; else -- cgit v1.1