Skip to content

RankBy and equivalent elements #826

Open
@cleoold

Description

@cleoold

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions