Permalink
Browse files

Update implementation of Array.shuffle! to check frozen correctly (as…

… per rubyspec)
  • Loading branch information...
Orion Edwards [GGL]
Orion Edwards [GGL] committed Jan 4, 2012
1 parent ff5f4bf commit 3ce9b1fc712eeb0bf9a3e4b6feb6700a6c4672b6
Showing with 1 addition and 0 deletions.
  1. +1 −0 Languages/Ruby/Libraries/Extensions/IListOps.cs
@@ -1865,6 +1865,7 @@ public static class IListOps {
[RubyMethod("shuffle!")]
public static RubyArray/*!*/ ShuffleInPlace(RubyContext/*!*/ context, RubyArray/*!*/ self) {
+ self.RequireNotFrozen();
var generator = context.RandomNumberGenerator;
for (int i = self.Count - 1; i >= 0; i--) {
int j = generator.Next(i + 1);

0 comments on commit 3ce9b1f

Please sign in to comment.