Use string.IsNullOrEmpty instead of .Length.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Mon, 26 May 2014 16:53:05 +0000 (18:53 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Mon, 26 May 2014 16:53:05 +0000 (18:53 +0200)
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs

index f7ff0a2f9bea47d9cfca2d827deacc401fc1aea1..2833e27fda1227ab3a49ddbc0f21c82908c3410e 100644 (file)
@@ -60,7 +60,7 @@ namespace Microsoft.Build.Tasks {
                        if (EmbedResources != null) {
                                foreach (ITaskItem item in EmbedResources) {
                                        string logical_name = item.GetMetadata ("LogicalName");
-                                       if (logical_name.Length > 0)
+                                       if (!string.IsNullOrEmpty (logical_name))
                                                commandLine.AppendSwitchIfNotNull ("/embed:", string.Format ("{0},{1}", item.ItemSpec, logical_name));
                                        else
                                                commandLine.AppendSwitchIfNotNull ("/embed:", item.ItemSpec);