diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-07-06 18:02:40 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-07-06 18:02:40 -0700 |
commit | d2263f56a47c546367d04e0e85712c211484a62a (patch) | |
tree | 26fb4c599e61e89a883c905eee9f43978b7959d3 /lib/chef/resource.rb | |
parent | 873f8592c06235e2102745de87f976c33be06709 (diff) | |
download | chef-perf.tar.gz |
Misc perf offenses from rubocop-performanceperf
A few pretty obvious ones that avoid returning large data sets that we then search for the data we want.
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 bd6757c6f7..07003e9431 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -672,7 +672,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" |