Skip to content

Commit d70383e

Browse files
millenomimundaym
authored andcommitted
Do not use casts with CF types.
1 parent e954b90 commit d70383e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/XMLDocument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ open class XMLDocument : XMLNode {
9999
@abstract Returns a document created from data. Parse errors are returned in <tt>error</tt>.
100100
*/
101101
public init(data: Data, options mask: XMLNode.Options = []) throws {
102-
let docPtr = _CFXMLDocPtrFromDataWithOptions((data as AnyObject) as! CFData, UInt32(mask.rawValue))
102+
let docPtr = _CFXMLDocPtrFromDataWithOptions(unsafeBitCast(data as NSData, to: CFData.self), UInt32(mask.rawValue))
103103
super.init(ptr: _CFXMLNodePtr(docPtr))
104104

105105
if mask.contains(.documentValidate) {

0 commit comments

Comments
 (0)