diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-15 09:54:23 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-15 19:41:16 +0900 |
commit | f94202fcc228d0348ca050a7b18a8f8a538a7305 (patch) | |
tree | 004eeca7aee783edaebdb1ba1217ee0e01469b62 /lib | |
parent | b7079e538437aacf079d82c21504e44d7396926a (diff) | |
download | ruby-f94202fcc228d0348ca050a7b18a8f8a538a7305.tar.gz |
Use compare_by_identity hash [Bug #16250]
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/color.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb index fbcb0bda6d..0198838c6d 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -70,7 +70,7 @@ module IRB # :nodoc: $stdout.tty? && supported? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb')) end - def inspect_colorable?(obj, seen: {}) + def inspect_colorable?(obj, seen: {}.compare_by_identity) case obj when String, Symbol, Regexp, Integer, Float, FalseClass, TrueClass, NilClass true @@ -137,8 +137,8 @@ module IRB # :nodoc: private def without_circular_ref(obj, seen:, &block) - return false if seen.key?(obj.object_id) - seen[obj.object_id] = true + return false if seen.key?(obj) + seen[obj] = true block.call ensure seen.delete(obj.object_id) |