فهرست منبع

[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 {