summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-27 10:51:51 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-27 10:51:51 -0700
commit5122f9f77f89ba026e77b36062b70b241c552792 (patch)
tree75a930f73e58e84a91707b10d86148af8b1a55a8 /lib/chef/chef_fs
parentb3dbca14e1b587f4367acf082392fb3aea7bb872 (diff)
downloadchef-5122f9f77f89ba026e77b36062b70b241c552792.tar.gz
Merge repetitive conditionals
So much easier to read and probably faster this way too. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/chef_fs')
-rw-r--r--lib/chef/chef_fs/data_handler/cookbook_data_handler.rb2
-rw-r--r--lib/chef/chef_fs/file_pattern.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
index 222e6069f3..ee1480c62e 100644
--- a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
+++ b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
@@ -24,7 +24,7 @@ class Chef
end
def preserve_key?(key)
- key == "cookbook_name" || key == "version"
+ %w{cookbook_name version}.include?(key)
end
def chef_class
diff --git a/lib/chef/chef_fs/file_pattern.rb b/lib/chef/chef_fs/file_pattern.rb
index 163319032b..37e72f379b 100644
--- a/lib/chef/chef_fs/file_pattern.rb
+++ b/lib/chef/chef_fs/file_pattern.rb
@@ -204,7 +204,7 @@ class Chef
end
# Skip // and /./ (pretend it's not there)
- if exact == "" || exact == "."
+ if ["", "."].include?(exact)
next
end