Skip to content

Commit

Permalink
Showing 3 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -4042,7 +4042,7 @@ public IRubyObject shuffle_bang(ThreadContext context, IRubyObject[] args) {
int i = realLength;
try {
while (i > 0) {
int r = (int) (RubyRandom.randomReal(context, randgen) * i);
int r = (int) RubyRandom.randomLongLimited(context, randgen, i - 1);
IRubyObject tmp = eltOk(--i);
eltSetOk(i, eltOk(r));
eltSetOk(r, tmp);
@@ -4168,10 +4168,6 @@ public IRubyObject sample(ThreadContext context, IRubyObject[] args) {
}
}

private int randomReal(ThreadContext context, IRubyObject randgen, int len) {
return (int) (RubyRandom.randomReal(context, randgen) * len);
}

private static void aryReverse(IRubyObject[] _p1, int p1, IRubyObject[] _p2, int p2) {
while(p1 < p2) {
IRubyObject tmp = _p1[p1];
3 changes: 0 additions & 3 deletions spec/tags/ruby/core/array/shuffle_tags.txt

This file was deleted.

2 changes: 1 addition & 1 deletion test/mri/excludes/TestArray.rb
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
exclude :test_repeated_permutation_with_callcc, "no callcc"
exclude :test_rindex2, "needs investigation"
exclude :test_sample_random, "gen2 conc modifies ary"
exclude :test_shuffle_random, "needs investigation"
exclude :test_shuffle_random, "gen conc modifies ary"
exclude :test_sort_bang_with_freeze, ""
exclude :test_sort_with_callcc, "no callcc"
exclude :test_to_h, ""

0 comments on commit d7b55f0

Please sign in to comment.