3 ms·
Or do: private static int CompareKVPByCount(KeyValuePair<string, int> a, KeyValuePair<string, int> b) { return a.Value.Compare(b.Value); } Or even:
by ajanuary 13y ago
Or do:
private static int CompareKVPByCount(KeyValuePair<string, int> a, KeyValuePair<string, int> b)
{
return a.Value.Compare(b.Value);
}
Or even:
kvpList.Sort(kvp => kvp.Value)
But that would probably be straying into authors "list of language features I've completely ignored for the last 5 years"