Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/2.26.x' of github.com:corona-warn-app/cwa-app-i…
Browse files Browse the repository at this point in the history
…os into release/2.26.x
  • Loading branch information
30mar committed Aug 10, 2022
2 parents 0e744ff + 00184b5 commit 2f212a8
Show file tree
Hide file tree
Showing 3 changed files with 697 additions and 602 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,16 @@ final class HealthCertificate: Codable, Equatable, Comparable, RecycleBinIdentif
// This covers scenarios where familyName and givenName were swapped.
let hasCrossIntersection_FamilyName_GivenName = familyNameComponents.intersection(other.givenNameComponents).isNotEmpty
let hasCrossIntersection_GivenName_FamilyName = givenNameComponents.intersection(other.familyNameComponents).isNotEmpty
let hasCrossNameIntersections = hasCrossIntersection_FamilyName_GivenName && hasCrossIntersection_GivenName_FamilyName

let hasCrossNameIntersectionWithOneEmptyName: Bool
if givenNameComponents.isEmpty && other.familyNameComponents.isEmpty {
hasCrossNameIntersectionWithOneEmptyName = familyNameComponents.intersection(other.givenNameComponents).isNotEmpty
} else if familyNameComponents.isEmpty && other.givenNameComponents.isEmpty {
hasCrossNameIntersectionWithOneEmptyName = givenNameComponents.intersection(other.familyNameComponents).isNotEmpty
} else {
hasCrossNameIntersectionWithOneEmptyName = false
}
let hasCrossNameIntersections = hasCrossNameIntersectionWithOneEmptyName || (hasCrossIntersection_FamilyName_GivenName && hasCrossIntersection_GivenName_FamilyName)

return hasNameIntersections || hasCrossNameIntersections
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class HealthCertificate_BelongsToSamePersonTests: XCTestCase {
}

private struct TesCaseName: Decodable {
let gnt: String
let fnt: String
let gnt: String?
let fnt: String?
}
}
Loading

0 comments on commit 2f212a8

Please sign in to comment.