mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
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:
1 parent
776c3f42cb
commit
cf064a0575
1 file changed
+1
-5
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user