ilya-biryukov added inline comments.
================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:45
+ if (!JSONArray) {
+ llvm::errs() << "Couldn't parse request.\n";
+ }
----------------
Return from function after error?
================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:47
+ }
+ FuzzyFindRequest Request;
+ for (const auto &Item : *JSONArray->getAsArray()) {
----------------
Maybe declare this var inside the loop where it's used?
================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:48
+ FuzzyFindRequest Request;
+ for (const auto &Item : *JSONArray->getAsArray()) {
+ fromJSON(Item, Request);
----------------
Check that the parsed value is an array and report an error if not?
https://reviews.llvm.org/D51971
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits