Collapse conditional statements into single expression

This commit is contained in:
Danny Mösch 2023-06-13 22:53:11 +02:00
parent ba42a6aa36
commit c8cd311615
1 changed files with 4 additions and 10 deletions

View File

@ -171,16 +171,10 @@ private class ExplicitSelfVisitor: DeclaredIdentifiersTrackingVisitor {
}
var isSelfRedundant: Bool {
if typeDeclKind == .likeStruct || functionCallType == .anonymousClosure {
return true
}
if selfCaptureKind == .strong && SwiftVersion.current >= .fiveDotThree {
return true
}
if selfCaptureKind == .weak && SwiftVersion.current >= .fiveDotEight {
return true
}
return false
typeDeclKind == .likeStruct
|| functionCallType == .anonymousClosure
|| selfCaptureKind == .strong && SwiftVersion.current >= .fiveDotThree
|| selfCaptureKind == .weak && SwiftVersion.current >= .fiveDotEight
}
}