diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-02-22 15:16:48 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-02-22 15:16:48 -0800 |
commit | c3eb3b7e851b691e42cd1a70098b04f3630dda7c (patch) | |
tree | 2b7043a0a8f10a096869108fd825faabb350cd33 | |
parent | 2787d7c1c034026537077452e0d3d93bfcb4dae8 (diff) | |
download | chef-c3eb3b7e851b691e42cd1a70098b04f3630dda7c.tar.gz |
Revert "turbo attribute merging"
This reverts commit 5b17173847fe3e6d2a976fecad065952c801522e.
-rw-r--r-- | lib/chef/node/immutable_collections.rb | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb index 3378bee2b5..13cb321890 100644 --- a/lib/chef/node/immutable_collections.rb +++ b/lib/chef/node/immutable_collections.rb @@ -198,7 +198,6 @@ class Chef class ImmutableMash < Mash alias_method :internal_clear, :clear alias_method :internal_key?, :key? # FIXME: could bypass convert_key in Mash for perf - alias_method :internal_each, :each include Immutablize include CommonAPI @@ -265,7 +264,6 @@ class Chef def reset @generated_cache = false - @short_circuit_attr_level = nil internal_clear # redundant? end @@ -275,20 +273,13 @@ class Chef @generated_cache = true end - # @api private - attr_accessor :short_circuit_attr_levels - private def generate_cache internal_clear - components = short_circuit_attr_levels ? short_circuit_attr_levels : Attribute::COMPONENTS.reverse - # merged_components is not entirely accurate due to the short-circuit - merged_components = [] - components.each do |component| + Attribute::COMPONENTS.reverse.each do |component| subhash = __node__.attributes.instance_variable_get(component).read(*__path__) unless subhash.nil? # FIXME: nil is used for not present - merged_components << component if subhash.kind_of?(Hash) subhash.keys.each do |key| next if internal_key?(key) @@ -299,12 +290,6 @@ class Chef end end end - if merged_components.size == 1 - # merged_components is accurate enough to tell us if we're not really merging - internal_each do |key, value| - value.short_circuit_attr_levels = merged_components if value.respond_to?(:short_circuit_attr_levels) - end - end end prepend Chef::Node::Mixin::StateTracking |