diff options
-rw-r--r-- | lib/irb/completion.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 1b9d96b8f9..319cb84303 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -214,12 +214,11 @@ module IRB # We could cache the result, but this is very fast already. # By using this approach, we avoid Module#name calls, which are # relatively slow when there are a lot of anonymous modules defined. - require 'set' - s = Set.new + s = {} scanner = lambda do |m| next if s.include?(m) # IRB::ExtendCommandBundle::EXCB recurses. - s << m + s[m] = true m.constants(false).each do |c| value = m.const_get(c) scanner.call(value) if value.is_a?(Module) |