OrderBy and OrderByDescending are stable?

后端 未结 2 1088
借酒劲吻你
借酒劲吻你 2020-12-06 08:55

I am currently reading Pro LINQ c# 2008, and in page 87 the guy says OrderBy and OrderByDescending are stable. But he says exactly the opposite in page 96. It looks to me as

相关标签:
2条回答
  • 2020-12-06 09:27

    Yes, they're definitely stable. I picked up the same error in my review of the book.

    Joe responded to that bit of my review with this:

    Just for your reader's knowledge, the ordering is now specified to be stable. Initially it was unstable, and was later changed to be stable but I was told it would be specified to be unstable, but apparently at some point, the specification was changed to be stable. My book was updated but apparently I missed a spot.

    So yes, it was a mistake.

    Overall it's a reasonably accurate book. (There are a few inaccuracies which are due to MSDN being inaccurate, but that's fairly easy to forgive.) There are far worse around :)

    0 讨论(0)
  • 2020-12-06 09:48

    According to MSDN, OrderBy is stable, as is OrderByDescending.

    0 讨论(0)
提交回复
热议问题