Skip to content

Commit 2243593

Browse files
committed
Remove redundant check for durationInNanos < 0
* Already checked in DurationToNanoSecondsNode.
1 parent ad99e51 commit 2243593

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/java/org/truffleruby/core/kernel/KernelNodes.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,12 +1614,7 @@ protected RubyBaseNodeWithExecute coerceDuration(RubyBaseNodeWithExecute duratio
16141614
@Specialization
16151615
protected long sleep(long durationInNanos,
16161616
@Cached BranchProfile errorProfile) {
1617-
if (durationInNanos < 0) {
1618-
errorProfile.enter();
1619-
throw new RaiseException(
1620-
getContext(),
1621-
coreExceptions().argumentError("time interval must be positive", this));
1622-
}
1617+
assert durationInNanos >= 0;
16231618

16241619
final RubyThread thread = getLanguage().getCurrentThread();
16251620

0 commit comments

Comments
 (0)