ioeric added a comment.

Could you add test? ;)



================
Comment at: clang-tools-extra/clangd/index/dex/Iterator.cpp:223
   std::vector<DocID> Result;
-  for (; !It.reachedEnd(); It.advance())
+  for (size_t Retreived = 0; !It.reachedEnd() && Retreived < Limit;
+       It.advance())
----------------
Where do we increment `Retrieved`?


================
Comment at: clang-tools-extra/clangd/index/dex/Iterator.cpp:223
   std::vector<DocID> Result;
-  for (; !It.reachedEnd(); It.advance())
+  for (size_t Retreived = 0; !It.reachedEnd() && Retreived < Limit;
+       It.advance())
----------------
ioeric wrote:
> Where do we increment `Retrieved`?
nit: `s/Retreived/Retrieved/`


================
Comment at: clang-tools-extra/clangd/index/dex/Iterator.h:108
+/// for the number of elements obtained before the iterator is exhausted.
+std::vector<DocID> consume(Iterator &It,
+                           size_t Limit = std::numeric_limits<size_t>::max());
----------------
nit: I think `Size of the returned ...` is just repeating the first two 
sentences. Maybe drop?


https://reviews.llvm.org/D50500



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to