Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

avoid superflous if

  • Loading branch information...
commit e69277e36a7004001408731eead8ce9f245d8aaa 1 parent b2a5be0
@flori flori authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/json/common.rb
View
6 lib/json/common.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.