소스 검색

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