== string.Empty is .Lenght == 0

This commit is contained in:
UbitUmarov
2022-01-13 20:31:52 +00:00
parent 6595e3ae26
commit fbbcc1edd7
149 changed files with 261 additions and 264 deletions

View File

@@ -326,7 +326,7 @@ namespace OpenSim.Services.Connectors
// trigger since current callers don't pass emtpy IDs
// We need the asset ID to route the request to the proper
// cluster member, so we can't have the server assign one.
if (asset.ID == string.Empty || asset.ID == stringUUIDZero)
if (asset.ID.Length == 0 || asset.ID == stringUUIDZero)
{
if (asset.FullID.IsZero())
{

View File

@@ -74,7 +74,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = assetConfig.GetString("AuthenticationServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[AUTH CONNECTOR]: No Server URI named in section AuthenticationService");
throw new Exception("Authentication connector init error");

View File

@@ -72,7 +72,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = authorizationConfig.GetString("AuthorizationServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[AUTHORIZATION CONNECTOR]: No Server URI named in section AuthorizationService");
throw new Exception("Authorization connector init error");

View File

@@ -76,7 +76,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = gridConfig.GetString("AvatarServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[AVATAR CONNECTOR]: No Server URI named in section AvatarService");
throw new Exception("Avatar connector init error");
@@ -118,7 +118,7 @@ namespace OpenSim.Services.Connectors
try
{
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
if (reply == null || (reply != null && reply == string.Empty))
if (string.IsNullOrEmpty(reply))
{
m_log.DebugFormat("[AVATAR CONNECTOR]: GetAgent received null or empty reply");
return null;

View File

@@ -69,7 +69,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = gridConfig.GetString("EstateServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[ESTATE CONNECTOR]: No Server URI named in section EstateService");
throw new Exception("Estate connector init error");

View File

@@ -73,7 +73,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = freeswitchConfig.GetString("FreeswitchServiceURL",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[FREESWITCH CONNECTOR]: No FreeswitchServiceURL named in section FreeSwitchVoice");
throw new Exception("Freeswitch connector init error");

View File

@@ -75,7 +75,7 @@ namespace OpenSim.Services.Connectors.Friends
string serviceURI = gridConfig.GetString("FriendsServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[FRIENDS SERVICE CONNECTOR]: No Server URI named in section FriendsService");
throw new Exception("Friends connector init error");

View File

@@ -75,7 +75,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = gridConfig.GetString("GridServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[GRID CONNECTOR]: No Server URI named in section GridService");
throw new Exception("Grid connector init error");
@@ -106,7 +106,7 @@ namespace OpenSim.Services.Connectors
try
{
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
if (reply != string.Empty)
if (!string.IsNullOrEmpty(reply))
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);

View File

@@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors
uri,
reqString,
m_Auth);
if (reply == null || (reply != null && reply == string.Empty))
if (string.IsNullOrEmpty(reply))
{
m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received null or empty reply");
return null;

View File

@@ -63,7 +63,7 @@ namespace OpenSim.Services.Connectors
// http://valley.virtualportland.org/simtest/Grid/?id=
//
uri = new Uri(serverURI + "xxx");
if (uri.Query == string.Empty)
if (uri.Query.Length == 0)
m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
else
{

View File

@@ -100,7 +100,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = config.GetString("InventoryServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService");
throw new Exception("Inventory connector init error");

View File

@@ -78,7 +78,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = config.GetString("MapImageServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[MAP IMAGE CONNECTOR]: No Server URI named in section MapImageService");
throw new Exception("MapImage connector init error");

View File

@@ -73,7 +73,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = gridConfig.GetString("MuteListServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[MUTELIST CONNECTOR]: No Server URI named in section GridUserService");
throw new Exception("MuteList connector init error");

View File

@@ -73,7 +73,7 @@ namespace OpenSim.Services.Connectors
string serviceURI = gridConfig.GetString("PresenceServerURI",
String.Empty);
if (serviceURI == String.Empty)
if (serviceURI.Length == 0)
{
m_log.Error("[PRESENCE CONNECTOR]: No Server URI named in section PresenceService");
throw new Exception("Presence connector init error");