Skip to content

Commit

Permalink
avoid superflous if
Browse files Browse the repository at this point in the history
  • Loading branch information
flori committed Apr 8, 2010
1 parent b2a5be0 commit e69277e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def deep_const_get(path) # :nodoc:
when c.empty? then p
when p.const_defined?(c) then p.const_get(c)
else
if (c = p.const_missing(c) rescue nil)
c
else
begin
p.const_missing(c)
rescue NameError
raise ArgumentError, "can't find const #{path}"
end
end
Expand Down

0 comments on commit e69277e

Please sign in to comment.