We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ddb60b commit ad5ffb9Copy full SHA for ad5ffb9
SwiftCompilerSources/Sources/SIL/Utilities/WalkUtils.swift
@@ -38,6 +38,14 @@ public enum WalkResult {
38
case abortWalk
39
}
40
41
+extension Sequence {
42
+ public func walk(
43
+ _ predicate: (Element) throws -> WalkResult
44
+ ) rethrows -> WalkResult {
45
+ return try contains { try predicate($0) == .abortWalk } ? .abortWalk : .continueWalk
46
+ }
47
+}
48
+
49
/// The path which is updated throughout a walk.
50
///
51
/// Usually this is just a SmallProjectionPath, but clients can implement their own path, e.g.
0 commit comments