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

@@ -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);