Skip to content

Commit

Permalink
Simplified Autoload#find_const
Browse files Browse the repository at this point in the history
  • Loading branch information
hosiawak committed Feb 29, 2012
1 parent f6f3a05 commit cb3c680
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions kernel/common/autoload18.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def find_const
unless constant.equal?(undefined)
if constant.equal? self
constant = Object.constant_table.fetch name, undefined
unless constant.equal?(undefined)
return constant
else
if constant.equal?(undefined)
@scope.constant_table.delete @name
Rubinius.inc_global_serial
return scope.const_missing(name)
Expand Down
4 changes: 1 addition & 3 deletions kernel/common/autoload19.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def find_const
unless constant.equal?(undefined)
if constant.equal? self
constant = Object.constant_table.fetch name, undefined
unless constant.equal?(undefined)
return constant
else
if constant.equal?(undefined)
return scope.const_missing(name)
end
end
Expand Down

0 comments on commit cb3c680

Please sign in to comment.