diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-08-03 15:21:16 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-08-03 16:23:27 -0700 |
commit | 9a6ac264ade2ca205b00e4247c7c2d4d8d757f4a (patch) | |
tree | b1d2192c5a04fa6920d92a30c00ca35d883fa98a /lib/chef/resource.rb | |
parent | c202ce4e318a6bc842158970aeb6b3d13fa6a0df (diff) | |
download | chef-9a6ac264ade2ca205b00e4247c7c2d4d8d757f4a.tar.gz |
Use .key? instead of keys.include
We don't need to create an array that we then search when we can just search the hash.
Also disable a few hash like calls that are false positives
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r-- | lib/chef/resource.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index f2390b5801..1530243b5d 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -673,7 +673,7 @@ class Chef ivars = instance_variables.map(&:to_sym) - HIDDEN_IVARS ivars.each do |ivar| iv = ivar.to_s.sub(/^@/, "") - if all_props.keys.include?(iv) + if all_props.key?(iv) text << " #{iv} #{all_props[iv]}\n" elsif (value = instance_variable_get(ivar)) && !(value.respond_to?(:empty?) && value.empty?) text << " #{iv} #{value_to_text(value)}\n" |