瀏覽代碼

[neko/cpp] remove try/catch in FileSystem.isDirectory and see what happens (see https://github.com/HaxeFoundation/haxelib/commit/1042f232324deaf0d2034f6ef1dcf2f66e3f1f7d#commitcomment-16721183)

Dan Korostelev 9 年之前
父節點
當前提交
37be44ea18
共有 2 個文件被更改,包括 4 次插入12 次删除
  1. 2 6
      std/cpp/_std/sys/FileSystem.hx
  2. 2 6
      std/neko/_std/sys/FileSystem.hx

+ 2 - 6
std/cpp/_std/sys/FileSystem.hx

@@ -67,12 +67,8 @@ class FileSystem {
 		}
 	}
 
-	public static function isDirectory( path : String ) : Bool {
-		return try {
-			kind(path) == kdir;
-		} catch(e:Dynamic) {
-			false;
-		}
+	public static inline function isDirectory( path : String ) : Bool {
+		return kind(path) == kdir;
 	}
 
 	public static function createDirectory( path : String ) : Void {

+ 2 - 6
std/neko/_std/sys/FileSystem.hx

@@ -64,12 +64,8 @@ class FileSystem {
 		}
 	}
 
-	public static function isDirectory( path : String ) : Bool {
-		return try {
-			kind(path) == kdir;
-		} catch(e:Dynamic) {
-			false;
-		}
+	public static inline function isDirectory( path : String ) : Bool {
+		return kind(path) == kdir;
 	}
 
 	public static function createDirectory( path : String ) : Void {