Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 87cea85

Browse files
committed
CR feedback
2 parents 99da3bf + 58d5d89 commit 87cea85

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ios/CodePush/CodePushDownloadHandler.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ -(void)download:(NSString*)url {
2424
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]
2525
cachePolicy:NSURLRequestUseProtocolCachePolicy
2626
timeoutInterval:60.0];
27-
NSOperationQueue *delegateQueue = [NSOperationQueue new];
28-
delegateQueue.underlyingQueue = self.operationQueue;
2927
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request
3028
delegate:self
3129
startImmediately:NO];
30+
NSOperationQueue *delegateQueue = [NSOperationQueue new];
31+
delegateQueue.underlyingQueue = self.operationQueue;
3232
[connection setDelegateQueue:delegateQueue];
3333
[connection start];
3434
}
@@ -53,31 +53,31 @@ -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
5353
if (headerOffset >= 4) {
5454
break;
5555
}
56-
56+
5757
const char *bytes = [data bytes];
5858
_header[headerOffset] = bytes[i];
5959
}
6060
}
61-
61+
6262
self.receivedContentLength = self.receivedContentLength + [data length];
63-
63+
6464
NSInteger bytesLeft = [data length];
65-
65+
6666
do {
6767
NSInteger bytesWritten = [self.outputFileStream write:[data bytes]
6868
maxLength:bytesLeft];
6969
if (bytesWritten == -1) {
7070
break;
7171
}
72-
72+
7373
bytesLeft -= bytesWritten;
7474
} while (bytesLeft > 0);
75-
75+
7676
self.progressCallback(self.expectedContentLength, self.receivedContentLength);
77-
77+
7878
// bytesLeft should not be negative.
7979
assert(bytesLeft >= 0);
80-
80+
8181
if (bytesLeft) {
8282
[self.outputFileStream close];
8383
[connection cancel];

0 commit comments

Comments
 (0)