Seems DistinctByIterator much clearer than DistinctIterator, any chance to make DistinctIterator simpler? #90514
-
The DistinctByIterator's implementation seems to be much clearer than runtime/src/libraries/System.Linq/src/System/Linq/Distinct.cs Lines 62 to 79 in 71a3d36 the DistinctIterator one runtime/src/libraries/System.Linq/src/System/Linq/Distinct.cs Lines 85 to 150 in 71a3d36 Any chance to make DistinctIterator looks like DistinctByIterator? Or is there any performance/code size related background prevent us from doing so? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
DistinctIterator is written that way because it allows implementing additional interfaces on the type, something Distinct can take advantage of more so than DistinctBy. You can see how that's utilized in the Distinct.SpeedOpt.cs file. |
Beta Was this translation helpful? Give feedback.
DistinctIterator is written that way because it allows implementing additional interfaces on the type, something Distinct can take advantage of more so than DistinctBy. You can see how that's utilized in the Distinct.SpeedOpt.cs file.