Browse Source

Code optimization

main
Cédric Belin 1 week ago
parent
commit
e69634aac2
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      src/which/Finder.hx

+ 2
- 4
src/which/Finder.hx View File

@@ -86,10 +86,8 @@ import php.NativeStructArray;
}

/** Checks that the specified `file` is executable according to the executable file extensions. **/
function checkFileExtension(file: String): Bool {
final extension = Path.extension(file).toLowerCase();
return extension.length > 0 ? extensions.contains('.$extension') : false;
}
function checkFileExtension(file: String)
return extensions.contains('.${Path.extension(file).toLowerCase()}');

/** Checks that the file represented by the specified `stats` is executable according to its permissions. **/
function checkFilePermissions(stats: FileStat): Promise<Bool> {


Loading…
Cancel
Save