Skip to content

Commit

Permalink
Updated for Swift 3.0
Browse files Browse the repository at this point in the history
Swift 3.0 Development 04-08-2016
  • Loading branch information
colemancda committed Aug 6, 2016
1 parent bd8b7a5 commit 8048cd2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/SwiftFoundation/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
guard let pointer = buffer.baseAddress
else { self.init(); return }

self.init(bytes: pointer, count: sizeof(SourceType.self) * buffer.count)
self.init(bytes: pointer, count: MemoryLayout<SourceType>.size * buffer.count)
}

// MARK: - Accessors
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFoundation/Hash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
public func Hash(_ data: Data) -> Int {

// more expensive than casting but that's not safe for large values.
return data.bytes.map({ Int($0) }).reduce(0, { $0.0 ^ $0.1 })
return data.bytes.map({ Int($0) }).reduce(0) { $0.0 ^ $0.1 }
}
2 changes: 1 addition & 1 deletion Sources/SwiftFoundation/JSONParse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public extension JSON.Value {
// could not parse
guard tokenerError != nil else { return nil }

self = self.dynamicType.init(jsonObject: jsonObject)
self.init(jsonObject: jsonObject)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftFoundation/Thread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class Thread {

// MARK: - Intialization

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

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

Expand Down Expand Up @@ -116,7 +116,7 @@ fileprivate extension Thread {

let closure: () -> ()

init(closure: () -> ()) {
init(closure: @escaping () -> ()) {

self.closure = closure
}
Expand Down

0 comments on commit 8048cd2

Please sign in to comment.