diff options
author | John Keiser <john@johnkeiser.com> | 2015-06-29 16:20:15 -0600 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-06-30 11:18:41 -0600 |
commit | 7f2efa0bdabee2745b9b61725d88944bedd44052 (patch) | |
tree | 95dc93c7059d18ac90b173fca227dd284f2131cc /lib/chef/resource.rb | |
parent | 2bf7afdba5496f5f3e7ba065650c6db5522fe8c1 (diff) | |
download | chef-7f2efa0bdabee2745b9b61725d88944bedd44052.tar.gz |
Optimize logic on class initialize so it doesn't fall into the
"look at all classes to see if they provide the DSL" else clause
when you're just setting resource_name (which happens on every
class). Perf fix for tests.
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 9510351d16..7965068037 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -1017,7 +1017,7 @@ class Chef if name name = name.to_sym # If our class is not already providing this name, provide it. - if !Chef::ResourceResolver.list(name).include?(self) + if !Chef::ResourceResolver.includes_handler?(name, self) provides name, canonical: true end @resource_name = name |