mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
RangeInfo: simplify some code by using STL extra. NFC
This commit is contained in:
@@ -320,11 +320,6 @@ static bool hasUnhandledError(ArrayRef<ASTNode> Nodes) {
|
||||
});
|
||||
}
|
||||
|
||||
static bool
|
||||
hasNodeThat(ArrayRef<ASTNode> Nodes, llvm::function_ref<bool(ASTNode)> Pred) {
|
||||
return std::any_of(Nodes.begin(), Nodes.end(), Pred);
|
||||
}
|
||||
|
||||
struct RangeResolver::Implementation {
|
||||
SourceFile &File;
|
||||
ASTContext &Ctx;
|
||||
@@ -359,7 +354,7 @@ private:
|
||||
|
||||
// Explicitly allow the selection of multiple case statments.
|
||||
auto IsCase = [](ASTNode N) { return N.isStmt(StmtKind::Case); };
|
||||
if (hasNodeThat(StartMatches, IsCase) && hasNodeThat(EndMatches, IsCase))
|
||||
if (llvm::any_of(StartMatches, IsCase) && llvm::any_of(EndMatches, IsCase))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user