summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych')
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index 26da83b8e1..eb4bab7513 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -147,8 +147,7 @@ module Psych
string = members.delete 'str'
if klass
- string = klass.allocate
- string.replace string
+ string = klass.allocate.replace string
end
init_with(string, members.map { |k,v| [k.to_s.sub(/^@/, ''),v] }, o)