Skip to content

Commit

Permalink
Passing nil for HTTPProgress chunk when unnecessary instead of using …
Browse files Browse the repository at this point in the history
…custom initializer.
  • Loading branch information
cryptoDevTrader committed Oct 27, 2016
1 parent 0f26118 commit cd5d749
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Sources/Just/Just.swift
Original file line number Diff line number Diff line change
Expand Up @@ -372,18 +372,6 @@ public struct HTTPProgress {
public var percent: Float {
return Float(bytesProcessed) / Float(bytesExpectedToProcess)
}

init(
type: Type,
bytesProcessed: Int64,
bytesExpectedToProcess: Int64,
chunk: Data? = nil)
{
self.type = type
self.bytesProcessed = bytesProcessed
self.bytesExpectedToProcess = bytesExpectedToProcess
self.chunk = chunk
}
}

let errorDomain = "net.justhttp.Just"
Expand Down Expand Up @@ -1075,7 +1063,8 @@ extension HTTP: URLSessionTaskDelegate, URLSessionDataDelegate {
HTTPProgress(
type: .upload,
bytesProcessed: totalBytesSent,
bytesExpectedToProcess: totalBytesExpectedToSend
bytesExpectedToProcess: totalBytesExpectedToSend,
chunk: nil
)
)
}
Expand Down

0 comments on commit cd5d749

Please sign in to comment.