Clean codes

pull/16190/head
Muxi Yan 6 years ago
parent aec84416a4
commit 0cabf27fa3
  1. 12
      src/objective-c/GRPCClient/GRPCCall.m

@ -167,13 +167,9 @@ const char *kCFStreamVarName = "grpc_cfstream";
id<GRXWriteable> responseWriteable = [[GRXWriteable alloc] initWithValueHandler:^(id value) {
dispatch_async(self->_dispatchQueue, ^{
if (self->_handler) {
NSDictionary *headers = nil;
if (!self->_initialMetadataPublished) {
headers = self->_call.responseHeaders;
self->_initialMetadataPublished = YES;
}
if (headers) {
[self issueInitialMetadata:headers];
[self issueInitialMetadata:self->_call.responseHeaders];
}
if (value) {
[self issueMessage:value];
@ -184,13 +180,9 @@ const char *kCFStreamVarName = "grpc_cfstream";
completionHandler:^(NSError *errorOrNil) {
dispatch_async(self->_dispatchQueue, ^{
if (self->_handler) {
NSDictionary *headers = nil;
if (!self->_initialMetadataPublished) {
headers = self->_call.responseHeaders;
self->_initialMetadataPublished = YES;
}
if (headers) {
[self issueInitialMetadata:headers];
[self issueInitialMetadata:self->_call.responseHeaders];
}
[self issueClosedWithTrailingMetadata:self->_call.responseTrailers error:errorOrNil];

Loading…
Cancel
Save