Skip to content

Commit e2338a3

Browse files
authored
Merge pull request #573 from michael-lehew/master
2 parents b888b0b + 008ccf9 commit e2338a3

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Foundation/NSKeyedUnarchiver.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ open class NSKeyedUnarchiver : NSCoder {
112112

113113
switch self._stream {
114114
case .data(let data):
115-
try plist = PropertyListSerialization.propertyList(from: data, options: PropertyListSerialization.MutabilityOptions.immutable, format: &format)
115+
try plist = PropertyListSerialization.propertyList(from: data, options: [], format: &format)
116116
break
117117
case .stream(let inputStream):
118-
try plist = PropertyListSerialization.propertyListWithStream(unsafeBitCast(inputStream, to: CFReadStream.self),
118+
try plist = PropertyListSerialization.propertyList(with: unsafeBitCast(inputStream, to: CFReadStream.self),
119119
length: 0,
120-
options: PropertyListSerialization.MutabilityOptions.immutable,
120+
options: [],
121121
format: &format)
122122
break
123123
}

Foundation/NSPropertyList.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ extension PropertyListSerialization {
2020
public struct MutabilityOptions : OptionSet {
2121
public let rawValue : UInt
2222
public init(rawValue: UInt) { self.rawValue = rawValue }
23-
24-
static let immutable = MutabilityOptions(rawValue: 0)
23+
2524
static let mutableContainers = MutabilityOptions(rawValue: 1)
2625
static let mutableContainersAndLeaves = MutabilityOptions(rawValue: 2)
2726
}
@@ -87,7 +86,7 @@ open class PropertyListSerialization : NSObject {
8786
}
8887
}
8988

90-
internal class func propertyListWithStream(_ stream: CFReadStream, length streamLength: Int, options opt: ReadOptions, format: UnsafeMutablePointer <PropertyListFormat>?) throws -> Any {
89+
internal class func propertyList(with stream: CFReadStream, length streamLength: Int, options opt: ReadOptions, format: UnsafeMutablePointer <PropertyListFormat>?) throws -> Any {
9190
var fmt = kCFPropertyListBinaryFormat_v1_0
9291
var error: Unmanaged<CFError>? = nil
9392
let decoded = withUnsafeMutablePointer(to: &fmt) { (outFmt: UnsafeMutablePointer<CFPropertyListFormat>) -> NSObject? in

0 commit comments

Comments
 (0)