diff options
| author | Michael Herold <michael.j.herold@gmail.com> | 2017-02-18 09:36:48 -0600 |
|---|---|---|
| committer | Michael Herold <michael.j.herold@gmail.com> | 2017-02-18 09:36:48 -0600 |
| commit | fc4f6e2fa9a4f0c73e02bbd1d0492ce8fdc29aa1 (patch) | |
| tree | 3e0452ac98bd4dba02b8617a629412c971517503 /lib | |
| parent | 6cbd5758224c29d8e7a8cd464eeeab54fc000cdc (diff) | |
| download | hashie-fc4f6e2fa9a4f0c73e02bbd1d0492ce8fdc29aa1.tar.gz | |
Fix a performance regression due to logging
By switching to `#respond_to?` we make the lookup of method collisions
a lot faster while retaining the ability to report on them.
Closes #410
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hashie/mash.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hashie/mash.rb b/lib/hashie/mash.rb index 4008feb..b45ccce 100644 --- a/lib/hashie/mash.rb +++ b/lib/hashie/mash.rb @@ -145,7 +145,7 @@ module Hashie def custom_writer(key, value, convert = true) #:nodoc: key_as_symbol = (key = convert_key(key)).to_sym - log_built_in_message(key_as_symbol) if methods.include?(key_as_symbol) + log_built_in_message(key_as_symbol) if respond_to?(key_as_symbol) regular_writer(key, convert ? convert_value(value) : value) end |
