vert-x3 / vertx-amqp-client

An AMQP client for Vert.x
Apache License 2.0
17 stars 18 forks source link

Simplify AmqpConnectionImpl#close() #60

Closed sebthom closed 3 years ago

sebthom commented 3 years ago

Motivation:

Reduce cognitive load to understand the AmqpConnectionImpl#close() method.

1) The else block around the closed.set(true); statement in line 208 is not necessary since the corresponding if block ends with an early return statement. 2) In case the code of lines 212-249 is reached, closed is always set to true, thus there is no need to call closed.set(true); again in the close/disconnect handlers