summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2010-04-08 09:09:19 +0200
committerFlorian Frank <flori@ping.de>2010-04-08 09:09:19 +0200
commite69277e36a7004001408731eead8ce9f245d8aaa (patch)
tree2d113d93e8f862aa4cf3a31faed456f5460e931c
parentb2a5be0eef9095154cc8c7751d0318a565dad6da (diff)
downloadjson-e69277e36a7004001408731eead8ce9f245d8aaa.tar.gz
avoid superflous if
-rw-r--r--lib/json/common.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/json/common.rb b/lib/json/common.rb
index a8aa016..244634b 100644
--- a/lib/json/common.rb
+++ b/lib/json/common.rb
@@ -38,9 +38,9 @@ module JSON
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