Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Commit 8048cd2

Browse files
committed
Updated for Swift 3.0
Swift 3.0 Development 04-08-2016
1 parent bd8b7a5 commit 8048cd2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Sources/SwiftFoundation/Data.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
guard let pointer = buffer.baseAddress
8686
else { self.init(); return }
8787

88-
self.init(bytes: pointer, count: sizeof(SourceType.self) * buffer.count)
88+
self.init(bytes: pointer, count: MemoryLayout<SourceType>.size * buffer.count)
8989
}
9090

9191
// MARK: - Accessors

Sources/SwiftFoundation/Hash.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
public func Hash(_ data: Data) -> Int {
1111

1212
// more expensive than casting but that's not safe for large values.
13-
return data.bytes.map({ Int($0) }).reduce(0, { $0.0 ^ $0.1 })
13+
return data.bytes.map({ Int($0) }).reduce(0) { $0.0 ^ $0.1 }
1414
}

Sources/SwiftFoundation/JSONParse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public extension JSON.Value {
2727
// could not parse
2828
guard tokenerError != nil else { return nil }
2929

30-
self = self.dynamicType.init(jsonObject: jsonObject)
30+
self.init(jsonObject: jsonObject)
3131
}
3232
}
3333

Sources/SwiftFoundation/Thread.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public final class Thread {
2121

2222
// MARK: - Intialization
2323

24-
public init(_ closure: () -> ()) throws {
24+
public init(_ closure: @escaping () -> ()) throws {
2525

2626
let holder = Unmanaged.passRetained(Closure(closure: closure))
2727

@@ -116,7 +116,7 @@ fileprivate extension Thread {
116116

117117
let closure: () -> ()
118118

119-
init(closure: () -> ()) {
119+
init(closure: @escaping () -> ()) {
120120

121121
self.closure = closure
122122
}

0 commit comments

Comments
 (0)