mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user