Fix MinBy and MaxBy handling of empty sources (#53544)
authorEirik Tsarpalis <eirik.tsarpalis@gmail.com>
Wed, 2 Jun 2021 05:56:50 +0000 (06:56 +0100)
committerGitHub <noreply@github.com>
Wed, 2 Jun 2021 05:56:50 +0000 (08:56 +0300)
commitdbb05eba3b229df3d4c15ce08de9f84c7febb7b3
treefb30bcab62467905ad74dd31a87601ead4a3d206
parent88053fe63d30e96810a4cb8921c48cea1c774738
Fix MinBy and MaxBy handling of empty sources (#53544)

Addresses a bug where the empty source behaviour
is determined by the key type rather than the source type.
src/libraries/System.Linq/src/System/Linq/Max.cs
src/libraries/System.Linq/src/System/Linq/Min.cs
src/libraries/System.Linq/tests/MaxTests.cs
src/libraries/System.Linq/tests/MinTests.cs