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 authored and Nicolas Laurent committed Nov 30, 2020
1 parent f780525 commit ea1542e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/ruby/truffleruby/core/range.rb
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 ea1542e

Please sign in to comment.