Clean up ahead of PR.

This commit is contained in:
Matthew Chen 2018-01-23 16:57:19 -05:00
parent a05acd0174
commit 149199138c
2 changed files with 7 additions and 10 deletions

View File

@ -298,7 +298,7 @@ NS_ASSUME_NONNULL_BEGIN
XCTAssertTrue(isValid);
}
// Simulates a legacy user who needs to convert their database.
// Simulates a legacy user who needs to convert their database.
- (void)testConversionWithoutYapDatabase
{
sqlite3 *db;

View File

@ -1,9 +1,5 @@
//
// NSData+hexString.m
// TextSecureKit
//
// Created by Frederic Jacobs on 28/10/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "NSData+hexString.h"
@ -13,16 +9,17 @@
- (NSString *)hexadecimalString {
/* Returns hexadecimal string of NSData. Empty string if data is empty. */
const unsigned char *dataBuffer = (const unsigned char *)[self bytes];
if (!dataBuffer)
return [NSString string];
if (!dataBuffer) {
return @"";
}
NSUInteger dataLength = [self length];
NSUInteger dataLength = [self length];
NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)];
for (NSUInteger i = 0; i < dataLength; ++i) {
[hexString appendFormat:@"%02x", dataBuffer[i]];
}
return [NSString stringWithString:hexString];
return [hexString copy];
}
@end