From a89cc64947ce0aec610cfefb2a2e7e95c75a0ec9 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 24 Apr 2015 14:33:45 -0700 Subject: [PATCH] Fixed dictionary usage --- src/objective-c/GRPCClient/private/GRPCWrappedCall.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index 8c8e30986fa..23a0b4b7d87 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -78,7 +78,7 @@ size_t nops = operations.count; grpc_op *ops_array = gpr_malloc(nops * sizeof(grpc_op)); size_t index = 0; - NSMutableDictionary * __block opProcessors = [NSMutableDictionary new]; + NSMutableDictionary * __block opProcessors = [NSMutableDictionary dictionary]; grpc_metadata *send_metadata = NULL; grpc_metadata_array *recv_initial_metadata; @@ -164,7 +164,7 @@ [NSException raise:NSInvalidArgumentException format:@"Unrecognized dictionary key"]; } current->op = [key intValue]; - [opProcessors setObject:opBlock forKey:key]; + opProcessors[key] = opBlock; } grpc_call_error error = grpc_call_start_batch(_call, ops_array, nops, (__bridge_retained void *)(^(grpc_op_error error){ if (error != GRPC_OP_OK) { @@ -174,14 +174,14 @@ [NSException raise:@"Operation Exception" format:@"The batch failed with an unknown error"]; } } - NSMutableDictionary *result = [NSMutableDictionary new]; + NSMutableDictionary *result = [NSMutableDictionary dictionary]; for (id key in opProcessors) { id(^block)(void) = opProcessors[key]; id value = block(); if (value == nil) { value = [NSNull null]; } - [result setObject:value forKey:key]; + result[key] = value; } if (handleCompletion) { handleCompletion(result);