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 From 9f4a548a49e4d7e10fd33d2c684cae8b177ac418 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Nov 2013 01:03:53 +0000 Subject: Fix false positive test failure in TestRepeatSameDrawContainingImageReusingTexture() and TestRepeatSameDrawContainingImage() if localhost has a webserver set up. Use 0.0.0.0 instead of localhost --- .../Scripting/VectorRender/Tests/VectorRenderModuleTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Scripting') diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs index 41baccc..7119137 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs @@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests TestHelpers.InMethod(); string dtText - = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://localhost/shouldnotexist.png"; + = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://0.0.0.0/shouldnotexist.png"; SetupScene(false); SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene); @@ -307,7 +307,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests TestHelpers.InMethod(); string dtText - = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://localhost/shouldnotexist.png"; + = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World; Image http://0.0.0.0/shouldnotexist.png"; SetupScene(true); SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene); -- cgit v1.1