socketry / async-container

Scalable multi-thread multi-process containers for Ruby.
MIT License
81 stars 4 forks source link

Rely on implicit return statements #9

Closed olleolleolle closed 4 years ago

olleolleolle commented 4 years ago

This PR removes explicitly added return statements where they're "implied".

I did this so that all the places "work and look the same". As a guide for the reader.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.03%) to 79.143% when pulling c70147ad192eb457d5116d7b5e28601a6c19d8fd on olleolleolle:return-statement-reduced-away into 45a2f5dab80e21647a14bc79cf1ce869f5f42ebe on socketry:master.

ioquatix commented 4 years ago

I don't like implicit return if there is more than one line of code in a method body. However, if I'm inconsistent, it's probably a mistake. The key point is it needs to be completely unambiguous that 1/ it's a return value and 2/ future modifications to the method can't possibly break the flow control of the method.

olleolleolle commented 4 years ago

Consistency is more important. Thanks for making a decision! Forward!