瀏覽代碼

Shortcircuit ProcessStartInfo Verbs logic.

Let's not do IO operations except if needed.
Ungureanu Marius 11 年之前
父節點
當前提交
c9ff84dacb
共有 1 個文件被更改,包括 5 次插入6 次删除
  1. 5 6
      mcs/class/System/System.Diagnostics/ProcessStartInfo.cs

+ 5 - 6
mcs/class/System/System.Diagnostics/ProcessStartInfo.cs

@@ -238,21 +238,20 @@ namespace System.Diagnostics
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden), Browsable (false)]
 		public string[] Verbs {
 			get {
-				string ext = filename == null | filename.Length == 0 ? 
-					null : Path.GetExtension (filename);
-				if (ext == null)
-					return empty;
-
 #if MOBILE
 				return empty;
 #else
-
 				switch (Environment.OSVersion.Platform) {
 				case (PlatformID)4:
 				case (PlatformID)6:
 				case (PlatformID)128:
 					return empty; // no verb on non-Windows
 				default:
+					string ext = filename == null | filename.Length == 0 ?
+						null : Path.GetExtension (filename);
+					if (ext == null)
+						return empty;
+
 					RegistryKey rk = null, rk2 = null, rk3 = null;
 					try {
 						rk = Registry.ClassesRoot.OpenSubKey (ext);