diff --git a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m index 4699b8e6b3e..c172c3c988c 100644 --- a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m +++ b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m @@ -59,13 +59,9 @@ NSMutableArray *opBatchLog = nil; + (NSArray *)obtainAndCleanOpBatchLog { @synchronized (opBatchLog) { - if (opBatchLog) { - NSArray *out = opBatchLog; - opBatchLog = [NSMutableArray array]; - return out; - } else { - return nil; - } + NSArray *out = opBatchLog; + opBatchLog = [NSMutableArray array]; + return out; } }