summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-02-23 11:09:43 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2018-02-23 11:09:43 -0800
commita50bfb54e2d570c73cf44cd021432e689e8efbe8 (patch)
treef57693295a181631db1a0355db4f22fed537999e
parent88a20c2096ef32140e10a7da862853bd486f70f5 (diff)
downloadchef-a50bfb54e2d570c73cf44cd021432e689e8efbe8.tar.gz
Revert "turbo attribute merging"
This reverts commit 5b17173847fe3e6d2a976fecad065952c801522e.
-rw-r--r--lib/chef/node/immutable_collections.rb17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb
index d290e32992..58ce58e61f 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
@@ -263,7 +262,6 @@ class Chef
def reset
@generated_cache = false
- @short_circuit_attr_level = nil
internal_clear # redundant?
end
@@ -273,20 +271,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.each_key do |key|
next if internal_key?(key)
@@ -297,12 +288,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