From 2c88b4616a3a59ed82eadd3b5506fabfc61456b5 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 28 Oct 2016 10:47:25 -0700 Subject: Revert format changes of unrelated files --- .../GRPCClient/private/GRPCRequestHeaders.m | 41 +++++++++------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'src/objective-c/GRPCClient/private/GRPCRequestHeaders.m') diff --git a/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m b/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m index 58c6032e80..c6a03c145e 100644 --- a/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m +++ b/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m @@ -38,10 +38,9 @@ #import "NSDictionary+GRPC.h" // Used by the setter. -static void CheckIsNonNilASCII(NSString *name, NSString *value) { +static void CheckIsNonNilASCII(NSString *name, NSString* value) { if (!value) { - [NSException raise:NSInvalidArgumentException - format:@"%@ cannot be nil", name]; + [NSException raise:NSInvalidArgumentException format:@"%@ cannot be nil", name]; } if (![value canBeConvertedToEncoding:NSASCIIStringEncoding]) { [NSException raise:NSInvalidArgumentException @@ -53,20 +52,15 @@ static void CheckIsNonNilASCII(NSString *name, NSString *value) { static void CheckKeyValuePairIsValid(NSString *key, id value) { if ([key hasSuffix:@"-bin"]) { if (![value isKindOfClass:NSData.class]) { - [NSException - raise:NSInvalidArgumentException - format:@"Expected NSData value for header %@ ending in \"-bin\", " - @"instead got %@", - key, value]; + [NSException raise:NSInvalidArgumentException + format:@"Expected NSData value for header %@ ending in \"-bin\", " + @"instead got %@", key, value]; } } else { if (![value isKindOfClass:NSString.class]) { - [NSException - raise:NSInvalidArgumentException - format: - @"Expected NSString value for header %@ not ending in \"-bin\", " - @"instead got %@", - key, value]; + [NSException raise:NSInvalidArgumentException + format:@"Expected NSString value for header %@ not ending in \"-bin\", " + @"instead got %@", key, value]; } CheckIsNonNilASCII(@"Text header value", (NSString *)value); } @@ -74,10 +68,9 @@ static void CheckKeyValuePairIsValid(NSString *key, id value) { @implementation GRPCRequestHeaders { __weak GRPCCall *_call; - // The NSMutableDictionary superclass doesn't hold any storage (so that people - // can implement their own in subclasses). As that's not the reason we're - // subclassing, we just delegate storage to the default NSMutableDictionary - // subclass returned by the cluster (e.g. __NSDictionaryM on iOS 9). + // The NSMutableDictionary superclass doesn't hold any storage (so that people can implement their + // own in subclasses). As that's not the reason we're subclassing, we just delegate storage to the + // default NSMutableDictionary subclass returned by the cluster (e.g. __NSDictionaryM on iOS 9). NSMutableDictionary *_delegate; } @@ -98,8 +91,7 @@ static void CheckKeyValuePairIsValid(NSString *key, id value) { } // Designated initializer -- (instancetype)initWithCall:(GRPCCall *)call - storage:(NSMutableDictionary *)storage { +- (instancetype)initWithCall:(GRPCCall *)call storage:(NSMutableDictionary *)storage { // TODO(jcanizales): Throw if call or storage are nil. if ((self = [super init])) { _call = call; @@ -108,10 +100,9 @@ static void CheckKeyValuePairIsValid(NSString *key, id value) { return self; } -- (instancetype) -initWithObjects:(const id _Nonnull __unsafe_unretained *)objects - forKeys:(const id _Nonnull __unsafe_unretained *)keys - count:(NSUInteger)cnt { +- (instancetype)initWithObjects:(const id _Nonnull __unsafe_unretained *)objects + forKeys:(const id _Nonnull __unsafe_unretained *)keys + count:(NSUInteger)cnt { return [self init]; } @@ -143,7 +134,7 @@ initWithObjects:(const id _Nonnull __unsafe_unretained *)objects return _delegate.count; } -- (NSEnumerator *_Nonnull)keyEnumerator { +- (NSEnumerator * _Nonnull)keyEnumerator { return [_delegate keyEnumerator]; } -- cgit v1.2.3