@@ -149,10 +149,10 @@ struct ByteTreeReader {
149
149
/// A pointer pointing to the next byte of serialized data to be read
150
150
private var pointer : UnsafeRawPointer
151
151
152
- private var userInfo : [ ByteTreeUserInfoKey : Any ]
152
+ private var userInfo : UnsafePointer < [ ByteTreeUserInfoKey : Any ] >
153
153
154
154
private init ( pointer: UnsafeRawPointer ,
155
- userInfo: [ ByteTreeUserInfoKey : Any ] ) {
155
+ userInfo: UnsafePointer < [ ByteTreeUserInfoKey : Any ] > ) {
156
156
self . pointer = pointer
157
157
self . userInfo = userInfo
158
158
}
@@ -172,7 +172,7 @@ struct ByteTreeReader {
172
172
/// failed
173
173
static func read< T: ByteTreeObjectDecodable > (
174
174
_ rootObjectType: T . Type , from pointer: UnsafeRawPointer ,
175
- userInfo: [ ByteTreeUserInfoKey : Any ] ,
175
+ userInfo: UnsafePointer < [ ByteTreeUserInfoKey : Any ] > ,
176
176
protocolVersionValidation: ( ProtocolVersion ) -> Bool
177
177
) throws -> T {
178
178
var reader = ByteTreeReader ( pointer: pointer, userInfo: userInfo)
@@ -192,7 +192,7 @@ struct ByteTreeReader {
192
192
/// - Returns: The deserialized tree
193
193
static func read< T: ByteTreeObjectDecodable > (
194
194
_ rootObjectType: T . Type , from data: Data ,
195
- userInfo: [ ByteTreeUserInfoKey : Any ] ,
195
+ userInfo: UnsafePointer < [ ByteTreeUserInfoKey : Any ] > ,
196
196
protocolVersionValidation versionValidate: ( ProtocolVersion ) -> Bool
197
197
) throws -> T {
198
198
return try data. withUnsafeBytes { ( pointer: UnsafePointer < UInt8 > ) in
@@ -273,7 +273,7 @@ struct ByteTreeReader {
273
273
objectReader. finalize ( )
274
274
}
275
275
return T . read ( from: & objectReader, numFields: numFields,
276
- userInfo: & userInfo)
276
+ userInfo: userInfo)
277
277
}
278
278
279
279
/// Read the next field in the tree as a scalar of the specified type.
@@ -287,7 +287,7 @@ struct ByteTreeReader {
287
287
defer {
288
288
pointer = pointer. advanced ( by: fieldSize)
289
289
}
290
- return T . read ( from: pointer, size: fieldSize, userInfo: & userInfo)
290
+ return T . read ( from: pointer, size: fieldSize, userInfo: userInfo)
291
291
}
292
292
293
293
/// Discard the next scalar field, advancing the pointer to the next field
0 commit comments