gribozavr2 added inline comments.
================ Comment at: clang/unittests/Tooling/Syntax/TreeTest.cpp:186-187 + auto AnnotatedRanges = AnnotatedCode.ranges(); + assert(AnnotatedRanges.size() == TreeDumps.size()); + for (auto i = 0u; i < AnnotatedRanges.size(); i++) { + auto *AnnotatedNode = nodeByRange(AnnotatedRanges[i], Root); ---------------- eduucaldas wrote: > I just wanted to do a for( auto [range, dump]& : > zip(AnnotatedRanges,TreeDumps)) > > Is indexed loop the way to go in C++? > And also I used `0u` here because we make a comparison to > `std::vector::size_type`, is there a less error-prone way of writing those > loop indexes? Yes, I believe what you have now is indeed the best way. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85713/new/ https://reviews.llvm.org/D85713 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits