We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a418c21 commit 26cba9aCopy full SHA for 26cba9a
Framework/Source Files/Extensions/Int.swift
@@ -7,10 +7,9 @@ import Foundation
7
8
/// Extension for signed integers allowing conversion to Data with proper size.
9
internal extension UnsignedInteger {
10
-
+
11
/// Returns decoded data with proper size.
12
var decodedData: Data {
13
- var mutableSelf = self
14
- return Data(bytes: &mutableSelf, count: MemoryLayout<Self>.size)
+ return withUnsafeBytes(of: self) { Data($0) }
15
}
16
0 commit comments