Use unsafelyUnwrapped more often
This commit is contained in:
parent
040b36d983
commit
64c7b16764
|
|
@ -10,7 +10,7 @@ private struct FamilyMemberContainer<R> where R: FamilyRequirementsManaging {
|
|||
}
|
||||
|
||||
extension CodingUserInfoKey {
|
||||
fileprivate static let nexusCodingStrategy = CodingUserInfoKey(rawValue: "nexusCodingStrategy")!
|
||||
fileprivate static let nexusCodingStrategy = CodingUserInfoKey(rawValue: "nexusCodingStrategy").unsafelyUnwrapped
|
||||
}
|
||||
|
||||
// MARK: - encoding
|
||||
|
|
|
|||
|
|
@ -127,10 +127,10 @@ extension Nexus {
|
|||
}
|
||||
|
||||
func add(entityWithId entityId: EntityIdentifier, toFamilyWithTraits traits: FamilyTraitSet) {
|
||||
familyMembersByTraits[traits]!.insert(entityId, at: entityId.id)
|
||||
familyMembersByTraits[traits].unsafelyUnwrapped.insert(entityId, at: entityId.id)
|
||||
}
|
||||
|
||||
func remove(entityWithId entityId: EntityIdentifier, fromFamilyWithTraits traits: FamilyTraitSet) {
|
||||
familyMembersByTraits[traits]!.remove(at: entityId.id)
|
||||
familyMembersByTraits[traits].unsafelyUnwrapped.remove(at: entityId.id)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,6 @@ public struct DefaultCodingStrategy: CodingStrategy {
|
|||
public init() { }
|
||||
|
||||
public func codingKey<C>(for componentType: C.Type) -> DynamicCodingKey where C: Component {
|
||||
DynamicCodingKey(stringValue: "\(C.self)")!
|
||||
DynamicCodingKey(stringValue: "\(C.self)").unsafelyUnwrapped
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue