[clang] c593993 - [Lex] Use a range-based for loop (NFC) (#169174)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 22 15:30:55 PST 2025
Author: Kazu Hirata
Date: 2025-11-22T15:30:51-08:00
New Revision: c5939937a4d1b7da4477762389dee0afa756bd9c
URL: https://github.com/llvm/llvm-project/commit/c5939937a4d1b7da4477762389dee0afa756bd9c
DIFF: https://github.com/llvm/llvm-project/commit/c5939937a4d1b7da4477762389dee0afa756bd9c.diff
LOG: [Lex] Use a range-based for loop (NFC) (#169174)
Identified with modernize-loop-convert.
Added:
Modified:
clang/lib/Lex/Preprocessor.cpp
Removed:
################################################################################
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index e003ad3a95570..0a25dc19548ec 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -1458,10 +1458,8 @@ void Preprocessor::removeCommentHandler(CommentHandler *Handler) {
bool Preprocessor::HandleComment(Token &result, SourceRange Comment) {
bool AnyPendingTokens = false;
- for (std::vector<CommentHandler *>::iterator H = CommentHandlers.begin(),
- HEnd = CommentHandlers.end();
- H != HEnd; ++H) {
- if ((*H)->HandleComment(*this, Comment))
+ for (CommentHandler *H : CommentHandlers) {
+ if (H->HandleComment(*this, Comment))
AnyPendingTokens = true;
}
if (!AnyPendingTokens || getCommentRetentionState())
More information about the cfe-commits
mailing list