Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 26762 Build 26761: arc lint + arc unit
Event Timeline
clangd/XRefs.cpp | ||
---|---|---|
724 | nit: move this to the top, since it's just adjusting input params? | |
730 | I don't think we need to break up the flow here to early exit. I'd suggest reducing the number of places we deal with limits, we can get away with 3 instead of 5: ... collect results as before ... if (Index && Limit && Results.size() < Limit) { ... query index ... Req.Limit = Limit; ... append results as usual ... } if (Limit && Results.size() > Limit) Results.resize(limit) | |
clangd/index/MemIndex.cpp | ||
72 | Req.Limit.getValueOr(...) | |
72 | if you're going to mutate this, maybe call it "remaining" or so? | |
clangd/index/Merge.cpp | ||
98 | why two separate count variables? | |
98 | you've inserted the new code between existing code and the comment that describes it. | |
unittests/clangd/DexTests.cpp | ||
673 | If you want these to be the same test, there should be some connection between them. | |
686 | As far as I can tell, this limit makes no difference, there's only one result anyway. | |
691 | In tests, we know what the number is, and it's clearer to just spell it out: EXPECT_EQ(1, RefCount) | |
691 | generally prefer to use EXPECT_THAT only with matchers. EXPECT_EQ gives clearer error messages, reads more naturally, and is more common. Better still would be to assert the actual outcomes, e.g. ElementsAre(anyOf("foo1.h", "foo2.h")) | |
unittests/clangd/IndexTests.cpp | ||
306 | why new scope here? |
unittests/clangd/DexTests.cpp | ||
---|---|---|
673 | Done, made the query request the same in this test except the limit. | |
686 | Actually, the filter of the request was different than the case above, we would get 2 refs. Used the same request to avoid confusion. | |
unittests/clangd/IndexTests.cpp | ||
306 | To align with the case above. |
unittests/clangd/DexTests.cpp | ||
---|---|---|
680 | instead of splitting scopes here, might be more obvious just to Files.clear() between? | |
unittests/clangd/IndexTests.cpp | ||
306 | FWIW I'd find it easier to read if neither this nor the one above used new scopes, which tend to suggest some spooky scoped object side effects to me. |
nit: move this to the top, since it's just adjusting input params?