diff --git a/Sources/FirebladeECS/Family+Coding.swift b/Sources/FirebladeECS/Family+Coding.swift index bbcd395..f6b6047 100644 --- a/Sources/FirebladeECS/Family+Coding.swift +++ b/Sources/FirebladeECS/Family+Coding.swift @@ -10,7 +10,7 @@ private struct FamilyMemberContainer where R: FamilyRequirementsManaging { } extension CodingUserInfoKey { - fileprivate static let nexusCodingStrategy = CodingUserInfoKey(rawValue: "nexusCodingStrategy").unsafelyUnwrapped + static let nexusCodingStrategy = CodingUserInfoKey(rawValue: "nexusCodingStrategy").unsafelyUnwrapped } // MARK: - encoding @@ -43,7 +43,7 @@ extension Family where R: FamilyEncoding { /// - Returns: The encoded data. public func encodeMembers(using encoder: inout Encoder) throws -> Encoder.Output where Encoder: TopLevelEncoder { encoder.userInfo[.nexusCodingStrategy] = nexus.codingStrategy - let components: [R.Components] = self.map { $0 } + let components = [R.Components](self) let container = FamilyMemberContainer(components: components) return try encoder.encode(container) } diff --git a/Sources/FirebladeECS/UnorderedSparseSet.swift b/Sources/FirebladeECS/UnorderedSparseSet.swift index ef0df7f..046f43c 100644 --- a/Sources/FirebladeECS/UnorderedSparseSet.swift +++ b/Sources/FirebladeECS/UnorderedSparseSet.swift @@ -13,15 +13,20 @@ /// /// See for a reference implementation. public struct UnorderedSparseSet { - @usableFromInline final class Storage { + // swiftlint:disable nesting + @usableFromInline + final class Storage { /// An index into the dense store. - public typealias DenseIndex = Int + @usableFromInline + typealias DenseIndex = Int /// A sparse store holding indices into the dense mapped to key. - public typealias SparseStore = [Key: DenseIndex] + @usableFromInline + typealias SparseStore = [Key: DenseIndex] /// A dense store holding all the entries. - public typealias DenseStore = ContiguousArray + @usableFromInline + typealias DenseStore = ContiguousArray @usableFromInline struct Entry { @@ -122,7 +127,8 @@ public struct UnorderedSparseSet { dense.removeAll(keepingCapacity: keepingCapacity) } - @inlinable func makeIterator() -> IndexingIterator> { + @inlinable + func makeIterator() -> IndexingIterator> { dense.makeIterator() } }