aaron.ballman added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/GlobList.cpp:56 bool GlobList::contains(StringRef S) { - bool Contains = false; - for (const GlobListItem &Item : Items) { + for (const GlobListItem &Item : llvm::reverse(Items)) { if (Item.Regex.match(S)) ---------------- njames93 wrote: > aaron.ballman wrote: > > I'd appreciate a comment here that mentions *why* reversing backwards means > > we can early return. It took me a few tries to remember that glob patterns > > can undo earlier glob patterns, so that the last pattern is the one that > > matters. > It does list that fact in the documentation for the function, but I'll put it > in here too. Oh, I missed that from the header -- nevermind, it's your call if you want to add the comment or not. :-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91033/new/ https://reviews.llvm.org/D91033 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits