Skip to content

Commit

Permalink
Remove Primitive.infect from Range#inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
Lillian Zhang committed Nov 28, 2020
1 parent b07bcf0 commit 80ff0a2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/ruby/truffleruby/core/range.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 80ff0a2

Please sign in to comment.