Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -321,7 +321,7 @@ public RubyNode visitBlockNode(org.jruby.ast.BlockNode node) {
if (child.getPosition() == InvalidSourcePosition.INSTANCE) {
parentSourceSection.push(sourceSection);
} else {
lastLine = Integer.max(lastLine, child.getPosition().getLine() + 1);
lastLine = Math.max(lastLine, child.getPosition().getLine() + 1);
}

final RubyNode translatedChild;
@@ -352,7 +352,7 @@ public RubyNode visitBlockNode(org.jruby.ast.BlockNode node) {
length += sourceSection.getSource().getLineLength(n);
}

length = Integer.min(length + startIndex, sourceSection.getSource().getLength()) - startIndex;
length = Math.min(length + startIndex, sourceSection.getSource().getLength()) - startIndex;

ret = SequenceNode.sequence(context, sourceSection.getSource().createSection(sourceSection.getIdentifier(), startIndex, length), translatedChildren.toArray(new RubyNode[translatedChildren.size()]));
}

1 comment on commit d90481f

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - sorry forgot this was Java 8 and my IDE doesn't tell me for some reason.

Sorry, something went wrong.

Please sign in to comment.