Skip to content

Commit abf5e26

Browse files
authored
(Performance) Remove an unnecessary syscall
1 parent f8afda2 commit abf5e26

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/rake/file_task.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ class FileTask < Task
1414
# Is this file task needed? Yes if it doesn't exist, or if its time stamp
1515
# is out of date.
1616
def needed?
17-
!File.exist?(name) || out_of_date?(timestamp) || @application.options.build_all
17+
begin
18+
out_of_date?(File.mtime(name)) || @application.options.build_all
19+
rescue Errno::ENOENT
20+
true
21+
end
1822
end
1923

2024
# Time stamp for file task.

0 commit comments

Comments
 (0)