summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-02-11 15:09:31 -0800
committerdanielsdeleo <dan@opscode.com>2013-02-11 15:09:31 -0800
commit6fc76ddba1b742a91b44f3e74d145d3e338bbafa (patch)
tree198aa1c82c2ebbcd42dd7e17b3b4448b634a8b9d /lib/chef
parentdfd324779943234fe639a3793f5b3e06bd41871b (diff)
downloadchef-6fc76ddba1b742a91b44f3e74d145d3e338bbafa.tar.gz
mutate the incoming hash
I'd rather not, but this object should be local to the caller at this point so it seems less bad than creating a bunch more objects
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/json_compat.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/chef/json_compat.rb b/lib/chef/json_compat.rb
index 68db64bef8..789884bcdf 100644
--- a/lib/chef/json_compat.rb
+++ b/lib/chef/json_compat.rb
@@ -77,11 +77,10 @@ class Chef
end
def map_hash_to_rb_obj(json_hash)
- mapped_hash = {}
json_hash.each do |key, value|
- mapped_hash[key] = map_to_rb_obj(value)
+ json_hash[key] = map_to_rb_obj(value)
end
- mapped_hash
+ json_hash
end
def to_json(obj, opts = nil)