diff options
Diffstat (limited to 'ext/psych/lib/psych')
-rw-r--r-- | ext/psych/lib/psych/visitors/to_ruby.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb index 49447e124a..b72fb4a1dc 100644 --- a/ext/psych/lib/psych/visitors/to_ruby.rb +++ b/ext/psych/lib/psych/visitors/to_ruby.rb @@ -368,11 +368,9 @@ module Psych hash end - if String.method_defined?(:-@) + if RUBY_VERSION < '2.7' def deduplicate key if key.is_a?(String) - # It is important to untaint the string, otherwise it won't - # be deduplicated into and fstring, but simply frozen. -(key.untaint) else key @@ -381,9 +379,7 @@ module Psych else def deduplicate key if key.is_a?(String) - # Deduplication is not supported by this implementation, - # but we emulate it's side effects - key.untaint.freeze + -key else key end |