From 80ff0a21d342423e2671042ab71629a35f5f9f6d Mon Sep 17 00:00:00 2001 From: Lillian Zhang Date: Sat, 28 Nov 2020 18:32:17 -0500 Subject: [PATCH] Remove Primitive.infect from Range#inspect --- src/main/ruby/truffleruby/core/range.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/ruby/truffleruby/core/range.rb b/src/main/ruby/truffleruby/core/range.rb index 1fbd6b0db5ea..dd7c4bb43b4a 100644 --- a/src/main/ruby/truffleruby/core/range.rb +++ b/src/main/ruby/truffleruby/core/range.rb @@ -375,12 +375,10 @@ def ===(value) def inspect sep = exclude_end? ? '...' : '..' if (Primitive.nil?(self.begin) && Primitive.nil?(self.end)) - result = "nil#{sep}nil" + "nil#{sep}nil" else - result = (Primitive.nil?(self.begin) ? '' : self.begin.inspect) + sep + - (Primitive.nil?(self.end) ? '' : self.end.inspect) + (Primitive.nil?(self.begin) ? '' : self.begin.inspect) + sep + (Primitive.nil?(self.end) ? '' : self.end.inspect) end - Primitive.infect(result, self) end def last(n=undefined)