Skip to content

Commit 034170a

Browse files
committed
RangeInfo: simplify some code by using STL extra. NFC
1 parent 534d7e9 commit 034170a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/IDE/SwiftSourceDocInfo.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,6 @@ static bool hasUnhandledError(ArrayRef<ASTNode> Nodes) {
320320
});
321321
}
322322

323-
static bool
324-
hasNodeThat(ArrayRef<ASTNode> Nodes, llvm::function_ref<bool(ASTNode)> Pred) {
325-
return std::any_of(Nodes.begin(), Nodes.end(), Pred);
326-
}
327-
328323
struct RangeResolver::Implementation {
329324
SourceFile &File;
330325
ASTContext &Ctx;
@@ -359,7 +354,7 @@ struct RangeResolver::Implementation {
359354

360355
// Explicitly allow the selection of multiple case statments.
361356
auto IsCase = [](ASTNode N) { return N.isStmt(StmtKind::Case); };
362-
if (hasNodeThat(StartMatches, IsCase) && hasNodeThat(EndMatches, IsCase))
357+
if (llvm::any_of(StartMatches, IsCase) && llvm::any_of(EndMatches, IsCase))
363358
return true;
364359
return false;
365360
}

0 commit comments

Comments
 (0)