From 8ce266449705c13fc6645b4e55e4f75411fb622c Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 7 Mar 2017 19:03:25 -0800 Subject: [PATCH] remove another redundant if statement --- src/objective-c/GRPCClient/private/GRPCOpBatchLog.m | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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; } }