Skip to content

Commit

Permalink
[CookbookVersionLoader#load_all_files] Do directory test after name c…
Browse files Browse the repository at this point in the history
…heck

Simple string comparison is cheaper than a `stat`

Signed-off-by: David Crosby <dcrosby@fb.com>
  • Loading branch information
dafyddcrosby committed Apr 23, 2024
1 parent d94cbe6 commit 688c10c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chef/cookbook/cookbook_version_loader.rb
Expand Up @@ -215,7 +215,7 @@ def load_all_files
Dir.entries(cookbook_path).each do |top_filename|
# Skip top-level directories starting with "."
top_path = File.join(cookbook_path, top_filename)
next if File.directory?(top_path) && top_filename.start_with?(".")
next if top_filename.start_with?(".") && File.directory?(top_path)

# Use Find.find because it:
# (a) returns any children, recursively
Expand Down

0 comments on commit 688c10c

Please sign in to comment.