[PATCH] D52028: [clangd] Cleanup FuzzyFindRequest filtering limit semantics

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 13 06:12:19 PDT 2018


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: clang-tools-extra/clangd/index/Index.h:477
   ///
-  /// Returns true if there may be more results (limited by MaxCandidateCount).
+  /// Returns true if there may be more results (limited by
+  /// FuzzyFindRequest.Limit).
----------------
nit: 'Req.Limit' would fit on the line


================
Comment at: clang-tools-extra/clangd/index/dex/Dex.cpp:182
   // when the requested number of items is small.
-  const size_t ItemsToRetrieve = 100 * Req.MaxCandidateCount;
-  auto Root = createLimit(move(QueryIterator), ItemsToRetrieve);
----------------
wow, this was overflowing!
I guess harmlessly to... numeric_limits<uint32>::max() - 99 or something? weird.


https://reviews.llvm.org/D52028





More information about the cfe-commits mailing list