Skip to content

Commit

Permalink
Merge pull request #706 from YuheiNakasaka/fix-redundant-to_str
Browse files Browse the repository at this point in the history
Fix redundant to_str call in JSON.[] method
  • Loading branch information
byroot authored Nov 14, 2024
2 parents d0dae8f + 61f022d commit 72bea9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def [](object, opts = {})
elsif object.respond_to?(:to_str)
str = object.to_str
if str.is_a?(String)
return JSON.parse(object.to_str, opts)
return JSON.parse(str, opts)
end
end

Expand Down

0 comments on commit 72bea9d

Please sign in to comment.