Skip to content

Commit aa22248

Browse files
committed
Cleanup
1 parent 34575aa commit aa22248

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/main/java/org/truffleruby/core/range/RangeNodes.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -471,29 +471,17 @@ protected RubyBaseNodeWithExecute coerceToBoolean(RubyBaseNodeWithExecute exclud
471471

472472
@Specialization(guards = "rubyClass == getRangeClass()")
473473
protected RubyIntRange intRange(RubyClass rubyClass, int begin, int end, boolean excludeEnd) {
474-
final RubyIntRange range = new RubyIntRange(
475-
excludeEnd,
476-
begin,
477-
end);
478-
return range;
474+
return new RubyIntRange(excludeEnd, begin, end);
479475
}
480476

481477
@Specialization(guards = { "rubyClass == getRangeClass()", "fitsInInteger(begin)", "fitsInInteger(end)" })
482478
protected RubyIntRange longFittingIntRange(RubyClass rubyClass, long begin, long end, boolean excludeEnd) {
483-
final RubyIntRange range = new RubyIntRange(
484-
excludeEnd,
485-
(int) begin,
486-
(int) end);
487-
return range;
479+
return new RubyIntRange(excludeEnd, (int) begin, (int) end);
488480
}
489481

490482
@Specialization(guards = { "rubyClass == getRangeClass()", "!fitsInInteger(begin) || !fitsInInteger(end)" })
491483
protected RubyLongRange longRange(RubyClass rubyClass, long begin, long end, boolean excludeEnd) {
492-
final RubyLongRange range = new RubyLongRange(
493-
excludeEnd,
494-
begin,
495-
end);
496-
return range;
484+
return new RubyLongRange(excludeEnd, begin, end);
497485
}
498486

499487
@Specialization(guards = { "!standardClass || (!isImplicitLong(begin) || !isImplicitLong(end))" })

0 commit comments

Comments
 (0)