diff options
author | Dave Mitchell <dave@connectedbits.com> | 2013-07-28 17:20:38 -0400 |
---|---|---|
committer | Dave Mitchell <dave@connectedbits.com> | 2013-07-28 17:20:38 -0400 |
commit | 35efddc3b2baf5253cac532cd668448ab0a81360 (patch) | |
tree | 44f10e4b62db68dbf4355f18d8af0c79e3919e49 /lib/hashie/extensions | |
parent | 3321005d0bd77e0811a2cea6dbbd302d8e86851f (diff) | |
download | hashie-35efddc3b2baf5253cac532cd668448ab0a81360.tar.gz |
Fixes Issue #106: deep_merge recursively slow
The call to custom_writer within deep_merge was exponentially converting the values (unnecessarily, since they were just converted within deep_merge). Added an optional param to custom_writer to suppress the conversion. Unfortunately, had to also add the param to coercion's customer_writer method as well (which is just ignored) to not break the inheritance.
All tests pass.
Diffstat (limited to 'lib/hashie/extensions')
-rw-r--r-- | lib/hashie/extensions/coercion.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hashie/extensions/coercion.rb b/lib/hashie/extensions/coercion.rb index c89f20d..9ba8288 100644 --- a/lib/hashie/extensions/coercion.rb +++ b/lib/hashie/extensions/coercion.rb @@ -21,7 +21,7 @@ module Hashie super(key, value) end - def custom_writer(key, value) + def custom_writer(key, value, convert=true) self[key] = value end |