• LCrawford (unregistered)

    Frist to wonder why this cluster wasn't replaced by a SortedDictionary type?

  • bvs23bkv33 (unregistered)

    select frist from comments order desc

  • (nodebb)

    var comment = CommentItems.OrderBy(x => x.Key).FristOrDefault();

  • Cameron (unregistered)

    This is honestly the first time a DWTF has actually exploded my head. I had to re-read the code four or five times to make sure I hadn't missed some spark of genius of something. It hurts!!

  • sizer99 (google)

    Yeah, as @LCrawford noted, C# even has this specific SortedDictionary type built in. And has for as long as I've been using .NET, going back at least to version 2.0. But if you're not retrieving them sorted often then normal dict + OrderBy will make your inserts faster.

    Tradeoffs! ... at least if you even know what your options are in the first place.

  • doubting_poster (unregistered) in reply to Cameron

    you use the word "actually". I don't think it means what you think it means. Or please supply us with a screenshot of you typing a comment with an exploded head. On second thought, that would be gross.

  • Little Bobby Tables (unregistered) in reply to doubting_poster

    I literally laughed my head off.

  • Ulysses (unregistered) in reply to doubting_poster

    You use the word "screenshot". I don't think it means what you (actually) think it means. :D

  • Navibulator (unregistered) in reply to Little Bobby Tables

    Sorry for your loss

  • TheGuy (unregistered)

    The data is supposed to be placed in a specific order, not just by title. It was able to be replaced with a list of mediaItem objects. Instead of keeping track of indices etc, you can just create a list with all of the items in the proper order. If you'll note from GetResultsWithSort, all it's doing is creating a list, sorted by the index passed in to AddRootItemWithSort

  • SageIkosa (unregistered)

    The object placed in Dictionary<string, object>["Sections"] is in fact an IEnumerable, not a materialized list.

Leave a comment on “Sorted by Title”

Log In or post as a guest

Replying to comment #:

« Return to Article