Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -92,6 +92,12 @@ public RandomizerRandIntPrimitiveNode(RubyContext context, SourceSection sourceS
super(context, sourceSection);
}

@Specialization
public int randomizerRandInt(DynamicObject randomizer, int limit) {
final Random r = Layouts.RANDOMIZER.getRandom(randomizer);
return (int) putIntoRange(r, (long) limit);
}

@Specialization
public long randomizerRandInt(DynamicObject randomizer, long limit) {
final Random r = Layouts.RANDOMIZER.getRandom(randomizer);

2 comments on commit 17ff676

@eregon
Copy link
Member

@eregon eregon commented on 17ff676 Sep 28, 2015

Choose a reason for hiding this comment

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

putIntoRange seems a strange name for this.

Sorry, something went wrong.

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 94ae555.

Sorry, something went wrong.

Please sign in to comment.