Skip to content

Commit 4ef8bbc

Browse files
committed
rename to shuffle
1 parent 78952b7 commit 4ef8bbc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Microsoft.DotNet.Interactive.AIUtilities.Tests/SamplingTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ public class SamplingTest
1212
public void can_shuffle_collection()
1313
{
1414
var src = Enumerable.Range(0, 10);
15-
var shuffled = src.RandomOrder().ToArray();
15+
var shuffled = src.Shuffle().ToArray();
1616
shuffled.Should().NotBeInAscendingOrder();
1717
}
1818

1919
[Fact]
2020
public void does_not_duplicate_items()
2121
{
2222
var src = Enumerable.Range(0, 10).ToArray();
23-
var shuffled = src.RandomOrder().Distinct().ToArray();
23+
var shuffled = src.Shuffle().Distinct().ToArray();
2424
shuffled.Should().HaveCount(src.Length);
2525
}
2626
}

src/Microsoft.DotNet.Interactive.AIUtilities/Sampling.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Microsoft.DotNet.Interactive.AIUtilities;
55

66
public static class Sampling
77
{
8-
public static IEnumerable<T> RandomOrder<T>(this IEnumerable<T> source)
8+
public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source)
99
{
1010
var rnd = new Random();
1111
var list = new List<T>(source);

0 commit comments

Comments
 (0)