Skip to content

Commit d3b98cd

Browse files
committed
format
1 parent b33e412 commit d3b98cd

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

QiniuSDK/Common/QNCrc32.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ + (UInt32)file:(NSString *)filePath
2727
if (*error != nil) {
2828
return 0;
2929
}
30-
31-
int len = (int)[data length];
32-
int count = (len + kQNBlockSize - 1) / kQNBlockSize;
33-
30+
31+
int len = (int)[data length];
32+
int count = (len + kQNBlockSize - 1) / kQNBlockSize;
33+
3434
uLong crc = crc32(0L, Z_NULL, 0);
35-
NSLog(@"%lu %d", crc, count);
35+
NSLog(@"%lu %d", crc, count);
3636
for (int i = 0; i < count; i++) {
3737
int offset = i * kQNBlockSize;
3838
int size = (len - offset) > kQNBlockSize ? kQNBlockSize : (len - offset);
3939
NSData *d = [data subdataWithRange:NSMakeRange(offset, (unsigned int)size)];
40-
crc = crc32(crc, [d bytes], (uInt)[d length]);
40+
crc = crc32(crc, [d bytes], (uInt)[d length]);
4141
}
42-
NSLog(@"%lu %d", crc, count);
42+
NSLog(@"%lu %d", crc, count);
4343
return (UInt32)crc;
4444
}
4545
}

QiniuSDK/Storage/QNUploadManager.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ - (void)putData:(NSData *)data
8181
mimeType = @"application/octet-stream";
8282
}
8383

84-
if (option && option.checkCrc) {
85-
parameters[@"crc32"] = [NSNumber numberWithUnsignedLong:[QNCrc32 data:data]];
86-
}
84+
if (option && option.checkCrc) {
85+
parameters[@"crc32"] = [NSNumber numberWithUnsignedLong:[QNCrc32 data:data]];
86+
}
8787

8888
QNInternalProgressBlock p = nil;
8989

QiniuSDKTests/QNCrc32Test.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ - (void)testData {
2424
}
2525

2626
- (void)testFile {
27-
NSError *error;
28-
NSURL *file = [QNTempFile createTempfileWithSize:5 * 1024 * 1024];
29-
UInt32 u = [QNCrc32 file:[file relativePath] error:&error];
27+
NSError *error;
28+
NSURL *file = [QNTempFile createTempfileWithSize:5 * 1024 * 1024];
29+
UInt32 u = [QNCrc32 file:[file relativePath] error:&error];
3030

31-
XCTAssert(u == 3376132981, @"Pass");
32-
[QNTempFile removeTempfile:file];
31+
XCTAssert(u == 3376132981, @"Pass");
32+
[QNTempFile removeTempfile:file];
3333
}
3434

3535
@end

0 commit comments

Comments
 (0)