summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-06 18:02:40 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-06 18:02:40 -0700
commitd2263f56a47c546367d04e0e85712c211484a62a (patch)
tree26fb4c599e61e89a883c905eee9f43978b7959d3 /lib/chef/resource.rb
parent873f8592c06235e2102745de87f976c33be06709 (diff)
downloadchef-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.rb2
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"