MoreLINQ
MoreLINQ copied to clipboard
RankBy and equivalent elements
I noticed that the RankBy
method does not group equivalent elements in one rank as in the Rank
method:
using static MoreLinq.Extensions.RankByExtension;
var strs = new string[] { "aaa", "xyz", "aaaa" };
var q = strs.RankBy(s => s.Length);
foreach (var i in q)
Console.WriteLine(i);
output:
2
3
1
This also happens when passing both key selector and comparer to RankBy
. There are no tests for this situation in the test file. Is this a bug or expected behaviour?