MoreLINQ icon indicating copy to clipboard operation
MoreLINQ copied to clipboard

RankBy and equivalent elements

Open cleoold opened this issue 3 years ago • 0 comments

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?

cleoold avatar Aug 20 '21 02:08 cleoold