Remove unnecessary if let usage in writeAndFlush (#365)

Motivation:

There was some if let usage that is not needed . We can remove it and just pass down the promise (no matter if its nil or not).

Modifications:

Remove if let

Result:

Code cleanup
This commit is contained in:
Norman Maurer authored and Cory Benfield committed 2018-04-27 09:48:34 +01:00
1 parent 776c3f42cb
commit cf064a0575
1 file changed
+1 -5
+1 -5
View File
@@ -1381,11 +1381,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
assert(promise.map { !$0.futureResult.isFulfilled } ?? true, "Promise \(promise!) already fulfilled")
if let outboundHandler = self.outboundHandler {
if let promise = promise {
outboundHandler.write(ctx: self, data: data, promise: promise)
} else {
outboundHandler.write(ctx: self, data: data, promise: nil)
}
outboundHandler.write(ctx: self, data: data, promise: promise)
outboundHandler.flush(ctx: self)
} else {
self.prev?.invokeWriteAndFlush(data, promise: promise)