2
0
Эх сурвалжийг харах

[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 жил өмнө
parent
commit
37be44ea18

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