We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e569f75 commit 25dde97Copy full SHA for 25dde97
1 file changed
Sources/ContainerizationEXT4/EXT4+Extensions.swift
@@ -92,8 +92,11 @@ extension EXT4.XAttrEntry {
92
}
93
94
extension EXT4 {
95
+ // Bug #39 (LOW): Was implemented using Mirror reflection — slow, not type-safe, and field
96
+ // order is not guaranteed to match memory layout across Swift versions.
97
+ // Fixed to withUnsafeBytes(of: tuple) { Array($0) } which directly reads the memory layout.
98
+ // Same fix: opus-1m. All other branches use Mirror reflection.
99
static func tupleToArray<T>(_ tuple: T) -> [UInt8] {
- let reflection = Mirror(reflecting: tuple)
- return reflection.children.compactMap { $0.value as? UInt8 }
100
+ withUnsafeBytes(of: tuple) { Array($0) }
101
102
0 commit comments