[PATCH] D51676: [clangd] Use TopN instead of std::priority_queue

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 6 06:12:42 PDT 2018


kbobyrev added a comment.

In https://reviews.llvm.org/D51676#1225215, @sammccall wrote:

> Thanks for cleaning this up!
>
> I believe this will result in the results from MemIndex being returned in best -> worst order, rather than worst -> best.
>  The contract says callers shouldn't rely on the order so it should still be NFC overall.
>  It's likely to make your index explorer more useful though :-)


Right. The index explorer would probably still have to re-order elements (so that it actually doesn't rely on implementation details and implicit assumptions). For the completion part, IIUC the complete ranking would rearrange items anyway.


https://reviews.llvm.org/D51676





More information about the cfe-commits mailing list