diff options
author | Justin Clark-Casey (justincc) | 2013-11-15 21:45:08 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-11-15 21:45:08 +0000 |
commit | 7cab41f4223b7febd3fdd42fa7cfefef25e4a9c9 (patch) | |
tree | 24a0c3d086944436431ccae6302cd7cc0ffa8407 /OpenSim/Framework | |
parent | If a local land ID is given to the "land show" command, then output to consol... (diff) | |
download | opensim-SC-7cab41f4223b7febd3fdd42fa7cfefef25e4a9c9.zip opensim-SC-7cab41f4223b7febd3fdd42fa7cfefef25e4a9c9.tar.gz opensim-SC-7cab41f4223b7febd3fdd42fa7cfefef25e4a9c9.tar.bz2 opensim-SC-7cab41f4223b7febd3fdd42fa7cfefef25e4a9c9.tar.xz |
refactor: replace verbose checks with String.IsNullOrEmpty where applicable.
Thanks to Kira for this patch from http://opensimulator.org/mantis/view.php?id=6845
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/InventoryItemBase.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Stats/Stat.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/TaskInventoryItem.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs index 43162fc..3152a7d 100644 --- a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs +++ b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | |||
@@ -121,7 +121,7 @@ namespace OpenSim.Framework.Configuration.XML | |||
121 | 121 | ||
122 | public void Commit() | 122 | public void Commit() |
123 | { | 123 | { |
124 | if (fileName == null || fileName == String.Empty) | 124 | if (string.IsNullOrEmpty(fileName)) |
125 | return; | 125 | return; |
126 | 126 | ||
127 | if (!Directory.Exists(Util.configDir())) | 127 | if (!Directory.Exists(Util.configDir())) |
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 3d45e76..558dfd0 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs | |||
@@ -122,7 +122,7 @@ namespace OpenSim.Framework | |||
122 | { | 122 | { |
123 | get | 123 | get |
124 | { | 124 | { |
125 | if (m_creatorData != null && m_creatorData != string.Empty) | 125 | if (!string.IsNullOrEmpty(m_creatorData)) |
126 | return m_creatorId + ';' + m_creatorData; | 126 | return m_creatorId + ';' + m_creatorData; |
127 | else | 127 | else |
128 | return m_creatorId; | 128 | return m_creatorId; |
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index 2b34493..e095801 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs | |||
@@ -231,7 +231,7 @@ namespace OpenSim.Framework.Monitoring | |||
231 | Container, | 231 | Container, |
232 | ShortName, | 232 | ShortName, |
233 | Value, | 233 | Value, |
234 | UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName)); | 234 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); |
235 | 235 | ||
236 | AppendMeasuresOfInterest(sb); | 236 | AppendMeasuresOfInterest(sb); |
237 | 237 | ||
@@ -316,9 +316,9 @@ namespace OpenSim.Framework.Monitoring | |||
316 | sb.AppendFormat( | 316 | sb.AppendFormat( |
317 | ", {0:0.##}{1}/s, {2:0.##}{3}/s", | 317 | ", {0:0.##}{1}/s, {2:0.##}{3}/s", |
318 | lastChangeOverTime, | 318 | lastChangeOverTime, |
319 | UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName), | 319 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName), |
320 | averageChangeOverTime, | 320 | averageChangeOverTime, |
321 | UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName)); | 321 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | } | 324 | } |
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index 88f9581..f2a6b8b 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | |||
@@ -277,7 +277,7 @@ namespace OpenSim.Framework.Serialization.External | |||
277 | writer.WriteStartElement("GroupOwned"); | 277 | writer.WriteStartElement("GroupOwned"); |
278 | writer.WriteString(inventoryItem.GroupOwned.ToString()); | 278 | writer.WriteString(inventoryItem.GroupOwned.ToString()); |
279 | writer.WriteEndElement(); | 279 | writer.WriteEndElement(); |
280 | if (options.ContainsKey("creators") && inventoryItem.CreatorData != null && inventoryItem.CreatorData != string.Empty) | 280 | if (options.ContainsKey("creators") && !string.IsNullOrEmpty(inventoryItem.CreatorData)) |
281 | writer.WriteElementString("CreatorData", inventoryItem.CreatorData); | 281 | writer.WriteElementString("CreatorData", inventoryItem.CreatorData); |
282 | else if (options.ContainsKey("home")) | 282 | else if (options.ContainsKey("home")) |
283 | { | 283 | { |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 76b4257..e1ae74e 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -785,7 +785,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
785 | "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}", | 785 | "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}", |
786 | RequestNumber, | 786 | RequestNumber, |
787 | Port, | 787 | Port, |
788 | (request.ContentType == null || request.ContentType == "") ? "not set" : request.ContentType, | 788 | string.IsNullOrEmpty(request.ContentType) ? "not set" : request.ContentType, |
789 | request.HttpMethod, | 789 | request.HttpMethod, |
790 | request.Url.PathAndQuery, | 790 | request.Url.PathAndQuery, |
791 | request.RemoteIPEndPoint); | 791 | request.RemoteIPEndPoint); |
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index a06f8e7..307cb75 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs | |||
@@ -124,7 +124,7 @@ namespace OpenSim.Framework | |||
124 | { | 124 | { |
125 | get | 125 | get |
126 | { | 126 | { |
127 | if (_creatorData != null && _creatorData != string.Empty) | 127 | if (!string.IsNullOrEmpty(_creatorData)) |
128 | return _creatorID.ToString() + ';' + _creatorData; | 128 | return _creatorID.ToString() + ';' + _creatorData; |
129 | else | 129 | else |
130 | return _creatorID.ToString(); | 130 | return _creatorID.ToString(); |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 706b33f..bcf6af8 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -720,7 +720,7 @@ namespace OpenSim.Framework | |||
720 | /// <returns></returns> | 720 | /// <returns></returns> |
721 | public static string[] GetPreferredImageTypes(string accept) | 721 | public static string[] GetPreferredImageTypes(string accept) |
722 | { | 722 | { |
723 | if (accept == null || accept == string.Empty) | 723 | if (string.IsNullOrEmpty(accept)) |
724 | return new string[0]; | 724 | return new string[0]; |
725 | 725 | ||
726 | string[] types = accept.Split(new char[] { ',' }); | 726 | string[] types = accept.Split(new char[] { ',' }); |