Peter Duniho <NpOeStPeAdM@nn owslpianmk.comw rote:
Could you give an example of what you mean? I'll try to work out what's
going on and whether there's a way round it.
>
I don't recall if the sort used in .NET is stable.
Enumerable.Orde rBy is stable. List.Sort isn't.
--
Jon Skeet - <skeet@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
As a side-note: I was intrigued to find that when the target of the
"orderby" clause is more complex -- for example, a lamba expression taking
a parameter and returning a value -- the compiler doesn't like that,
complaining that it can't do type inference. In spite of the fact that
simply replacing "orderby" with an explicit call to the "OrderBy()" method
fixes it.
"orderby" clause is more complex -- for example, a lamba expression taking
a parameter and returning a value -- the compiler doesn't like that,
complaining that it can't do type inference. In spite of the fact that
simply replacing "orderby" with an explicit call to the "OrderBy()" method
fixes it.
going on and whether there's a way round it.
And I
don't what happens if the rnd.Next call returns a duplicate number in
the range and how that affects the ordering of the results.
don't what happens if the rnd.Next call returns a duplicate number in
the range and how that affects the ordering of the results.
I don't recall if the sort used in .NET is stable.
--
Jon Skeet - <skeet@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Comment