Remove unnecessary async processing

This commit is contained in:
Ira Limitanei 2024-07-04 11:06:25 +09:00
parent 1fc0647d90
commit 69ca6625dd
No known key found for this signature in database
GPG Key ID: 3B416C2117091FF3

View File

@ -101,24 +101,6 @@ struct BindingReactorDemo: View {
}
}
private func checkPassword(content password: String) async -> [(String, Bool)] {
var results: [(String, Bool)] = []
await withTaskGroup(of: (String, Bool).self) { group in
for checker in PasswordChecker.allCases {
group.addTask {
await check(password: password, checker: checker)
}
}
for await result in group {
results.append(result)
}
}
return results
}
private func check(password: String, checker: PasswordChecker) -> (String, Bool) {
switch checker {
case .length: