diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-08-21 13:25:07 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-09-08 15:31:31 -0700 |
commit | 3ad78a92c06d39248add9f7d603adf395d8dbda0 (patch) | |
tree | 9d220614e7c7e2b18e4b58d388030b2db004c2f4 | |
parent | 6406afc2cee91f3e015c1b0b3f8bea305886eceb (diff) | |
download | chef-3ad78a92c06d39248add9f7d603adf395d8dbda0.tar.gz |
performance notes
-rw-r--r-- | lib/chef/node/attribute_cell.rb | 1 | ||||
-rw-r--r-- | lib/chef/node/attribute_trait/decorator.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/node/attribute_cell.rb b/lib/chef/node/attribute_cell.rb index f37e95e361..5e13ba8357 100644 --- a/lib/chef/node/attribute_cell.rb +++ b/lib/chef/node/attribute_cell.rb @@ -66,6 +66,7 @@ class Chef end end + # for performance we delegate Enumerable methods rather than implementing it Enumerable.instance_methods.each do |method| define_method method do |*args, &block| as_simple_object.public_send(method, *args, &block) diff --git a/lib/chef/node/attribute_trait/decorator.rb b/lib/chef/node/attribute_trait/decorator.rb index d7f83c3a97..c9988ec945 100644 --- a/lib/chef/node/attribute_trait/decorator.rb +++ b/lib/chef/node/attribute_trait/decorator.rb @@ -8,6 +8,7 @@ class Chef attr_accessor :wrapped_object + # for performance we delegate Enumerable methods rather than implementing it Enumerable.instance_methods.each do |method| define_method method do |*args, &block| wrapped_object.public_send(method, *args, &block) |