Q
qglyirnyfgfo
I noticed that LINQ Min and Max methods have concrete implementations
for some of the primitive data types but not for all. For example,
LINQ has a Max concrete implementation for int collections defined as:
public static int Max(this IEnumerable<int> source)
Other concrete implementations avalable are, Decimal, Decimal?,
Double, Double? Etc.
My question is, why does LINQ not have concrete implementation for
*all* primitive types? For example, if you have a uint collection you
will need to use the generic Max method and this method will not be as
efficient as if there was a concrete implementation for unit
collections such as:
public static int Max(this IEnumerable< uint > source)
I realize that some of the privative types that were left out are not
used as much as the ones that were implemented but come on, how long
would have taken a Microsoft employee to implement this methods? It’s
basically copy and paste from the other methods.
Certainly, there must be other reasons for why they decided to go this
way. Perhaps I will find such reason later as I learn more LINQ but
for now, I was wondering if someone could shed some length to me.
Thank you.
for some of the primitive data types but not for all. For example,
LINQ has a Max concrete implementation for int collections defined as:
public static int Max(this IEnumerable<int> source)
Other concrete implementations avalable are, Decimal, Decimal?,
Double, Double? Etc.
My question is, why does LINQ not have concrete implementation for
*all* primitive types? For example, if you have a uint collection you
will need to use the generic Max method and this method will not be as
efficient as if there was a concrete implementation for unit
collections such as:
public static int Max(this IEnumerable< uint > source)
I realize that some of the privative types that were left out are not
used as much as the ones that were implemented but come on, how long
would have taken a Microsoft employee to implement this methods? It’s
basically copy and paste from the other methods.
Certainly, there must be other reasons for why they decided to go this
way. Perhaps I will find such reason later as I learn more LINQ but
for now, I was wondering if someone could shed some length to me.
Thank you.